MongoDB  2.0.3
Public Member Functions
mongo::DBClientInterface Class Reference

The interface that any db connection should implement. More...

#include <dbclient.h>

Inheritance diagram for mongo::DBClientInterface:
mongo::DBClientWithCommands mongo::DBClientBase mongo::DBClientConnection mongo::DBClientReplicaSet mongo::SyncClusterConnection

List of all members.

Public Member Functions

virtual auto_ptr< DBClientCursorquery (const string &ns, Query query, int nToReturn=0, int nToSkip=0, const BSONObj *fieldsToReturn=0, int queryOptions=0, int batchSize=0)=0
virtual void insert (const string &ns, BSONObj obj, int flags=0)=0
virtual void insert (const string &ns, const vector< BSONObj > &v, int flags=0)=0
virtual void remove (const string &ns, Query query, bool justOne=0)=0
virtual void update (const string &ns, Query query, BSONObj obj, bool upsert=0, bool multi=0)=0
virtual BSONObj findOne (const string &ns, const Query &query, const BSONObj *fieldsToReturn=0, int queryOptions=0)
void findN (vector< BSONObj > &out, const string &ns, Query query, int nToReturn, int nToSkip=0, const BSONObj *fieldsToReturn=0, int queryOptions=0)
 query N objects from the database into an array.
virtual string getServerAddress () const =0
virtual auto_ptr< DBClientCursorgetMore (const string &ns, long long cursorId, int nToReturn=0, int options=0)=0
 don't use this - called automatically by DBClientCursor for you

Detailed Description

The interface that any db connection should implement.


Member Function Documentation

void mongo::DBClientInterface::findN ( vector< BSONObj > &  out,
const string &  ns,
Query  query,
int  nToReturn,
int  nToSkip = 0,
const BSONObj fieldsToReturn = 0,
int  queryOptions = 0 
)

query N objects from the database into an array.

makes sense mostly when you want a small number of results. if a huge number, use query() and iterate the cursor.

BSONObj mongo::DBClientInterface::findOne ( const string &  ns,
const Query query,
const BSONObj fieldsToReturn = 0,
int  queryOptions = 0 
) [virtual]
Returns:
a single object that matches the query. if none do, then the object is empty
Exceptions:
AssertionException

Reimplemented in mongo::DBClientReplicaSet, and mongo::SyncClusterConnection.


The documentation for this class was generated from the following files: