abstract class that implements the core db operations More...
#include <dbclient.h>
Public Member Functions | |
| WriteConcern | getWriteConcern () const |
| void | setWriteConcern (WriteConcern w) |
| virtual auto_ptr< DBClientCursor > | query (const string &ns, Query query, int nToReturn=0, int nToSkip=0, const BSONObj *fieldsToReturn=0, int queryOptions=0, int batchSize=0) |
| send a query to the database. | |
| virtual auto_ptr< DBClientCursor > | getMore (const string &ns, long long cursorId, int nToReturn=0, int options=0) |
| don't use this - called automatically by DBClientCursor for you | |
| virtual void | insert (const string &ns, BSONObj obj, int flags=0) |
| insert an object into the database | |
| virtual void | insert (const string &ns, const vector< BSONObj > &v, int flags=0) |
| insert a vector of objects into the database | |
| virtual void | remove (const string &ns, Query q, bool justOne=0) |
| remove matching objects from the database | |
| virtual void | update (const string &ns, Query query, BSONObj obj, bool upsert=false, bool multi=false) |
| updates objects matching query | |
| virtual bool | isFailed () const =0 |
| virtual void | killCursor (long long cursorID)=0 |
| virtual bool | callRead (Message &toSend, Message &response)=0 |
|
virtual ConnectionString::ConnectionType | type () const =0 |
| virtual double | getSoTimeout () const =0 |
Protected Attributes | |
| WriteConcern | _writeConcern |
abstract class that implements the core db operations
| auto_ptr< DBClientCursor > mongo::DBClientBase::getMore | ( | const string & | ns, | |
| long long | cursorId, | |||
| int | nToReturn = 0, |
|||
| int | options = 0 | |||
| ) | [virtual] |
don't use this - called automatically by DBClientCursor for you
| cursorId | id of cursor to retrieve |
| AssertionException |
Implements mongo::DBClientInterface.
Reimplemented in mongo::SyncClusterConnection.
| auto_ptr< DBClientCursor > mongo::DBClientBase::query | ( | const string & | ns, | |
| Query | query, | |||
| int | nToReturn = 0, |
|||
| int | nToSkip = 0, |
|||
| const BSONObj * | fieldsToReturn = 0, |
|||
| int | queryOptions = 0, |
|||
| int | batchSize = 0 | |||
| ) | [virtual] |
send a query to the database.
| ns | namespace to query, format is <dbname>.<collectname>[.<collectname>]* | |
| query | query to perform on the collection. this is a BSONObj (binary JSON) You may format as { query: { ... }, orderby: { ... } } to specify a sort order. | |
| nToReturn | n to return (i.e., limit). 0 = unlimited | |
| nToSkip | start with the nth item | |
| fieldsToReturn | optional template of which fields to select. if unspecified, returns all fields | |
| queryOptions | see options enum at top of this file |
| AssertionException |
Implements mongo::DBClientInterface.
Reimplemented in mongo::DBClientConnection, mongo::DBClientReplicaSet, and mongo::SyncClusterConnection.
| void mongo::DBClientBase::remove | ( | const string & | ns, | |
| Query | q, | |||
| bool | justOne = 0 | |||
| ) | [virtual] |
remove matching objects from the database
| justOne | if this true, then once a single match is found will stop |
Implements mongo::DBClientInterface.
Reimplemented in mongo::DBClientReplicaSet, and mongo::SyncClusterConnection.
1.6.3