#include <dbclient.h>

Public Member Functions | |
| virtual bool | callRead (Message &toSend, Message &response)=0 |
| DBClientBase () | |
| virtual auto_ptr< DBClientCursor > | getMore (const string &ns, long long cursorId, int nToReturn=0, int options=0) |
| WriteConcern | getWriteConcern () const |
| virtual void | insert (const string &ns, const vector< BSONObj > &v) |
| virtual void | insert (const string &ns, BSONObj obj) |
| virtual bool | isFailed () const =0 |
| virtual void | killCursor (long long cursorID)=0 |
| 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) |
| virtual void | remove (const string &ns, Query q, bool justOne=0) |
| virtual void | say (Message &toSend)=0 |
| void | setWriteConcern (WriteConcern w) |
| virtual ConnectionString::ConnectionType | type () const =0 |
| virtual void | update (const string &ns, Query query, BSONObj obj, bool upsert=false, bool multi=false) |
Protected Attributes | |
| WriteConcern | _writeConcern |
abstract class that implements the core db operations
Definition at line 699 of file dbclient.h.
| mongo::DBClientBase::DBClientBase | ( | ) | [inline] |
Definition at line 704 of file dbclient.h.
Implemented in mongo::DBClientConnection, mongo::DBClientReplicaSet, mongo::SyncClusterConnection, and mongo::DBDirectClient.
| virtual 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.
| WriteConcern mongo::DBClientBase::getWriteConcern | ( | ) | const [inline] |
Definition at line 708 of file dbclient.h.
| virtual void mongo::DBClientBase::insert | ( | const string & | ns, | |
| const vector< BSONObj > & | v | |||
| ) | [virtual] |
insert a vector of objects into the database
Implements mongo::DBClientInterface.
Reimplemented in mongo::DBClientReplicaSet, and mongo::SyncClusterConnection.
| virtual void mongo::DBClientBase::insert | ( | const string & | ns, | |
| BSONObj | obj | |||
| ) | [virtual] |
insert an object into the database
Implements mongo::DBClientInterface.
Reimplemented in mongo::DBClientReplicaSet, and mongo::SyncClusterConnection.
| virtual bool mongo::DBClientBase::isFailed | ( | ) | const [pure virtual] |
Implemented in mongo::DBClientConnection, mongo::DBClientReplicaSet, mongo::SyncClusterConnection, and mongo::DBDirectClient.
| virtual void mongo::DBClientBase::killCursor | ( | long long | cursorID | ) | [pure virtual] |
Implemented in mongo::DBClientConnection, mongo::DBClientReplicaSet, mongo::SyncClusterConnection, and mongo::DBDirectClient.
| virtual 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.
| virtual 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.
| virtual void mongo::DBClientBase::say | ( | Message & | toSend | ) | [pure virtual] |
Implements mongo::DBConnector.
Implemented in mongo::DBClientConnection, mongo::DBClientReplicaSet, mongo::SyncClusterConnection, and mongo::DBDirectClient.
| void mongo::DBClientBase::setWriteConcern | ( | WriteConcern | w | ) | [inline] |
Definition at line 709 of file dbclient.h.
| virtual ConnectionString::ConnectionType mongo::DBClientBase::type | ( | ) | const [pure virtual] |
Implemented in mongo::DBClientConnection, mongo::DBClientReplicaSet, mongo::SyncClusterConnection, and mongo::DBDirectClient.
| virtual void mongo::DBClientBase::update | ( | const string & | ns, | |
| Query | query, | |||
| BSONObj | obj, | |||
| bool | upsert = false, |
|||
| bool | multi = false | |||
| ) | [virtual] |
updates objects matching query
Implements mongo::DBClientInterface.
Reimplemented in mongo::DBClientReplicaSet, and mongo::SyncClusterConnection.
WriteConcern mongo::DBClientBase::_writeConcern [protected] |
Definition at line 701 of file dbclient.h.