mongo::DBClientBase Class Reference

abstract class that implements the core db operations More...

#include <dbclient.h>

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

List of all members.

Public Member Functions

WriteConcern getWriteConcern () const
void setWriteConcern (WriteConcern w)
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)
 send a query to the database.
virtual auto_ptr< DBClientCursorgetMore (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

Detailed Description

abstract class that implements the core db operations


Member Function Documentation

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

Parameters:
cursorId id of cursor to retrieve
Returns:
an handle to a previously allocated cursor
Exceptions:
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.

Parameters:
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
Returns:
cursor. 0 if error (connection failure)
Exceptions:
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

Parameters:
justOne if this true, then once a single match is found will stop

Implements mongo::DBClientInterface.

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


The documentation for this class was generated from the following files:
Generated on Wed Sep 14 01:46:39 2011 for MongoDB by  doxygen 1.6.3