summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2010-07-21 16:30:32 -0400
committerEliot Horowitz <eliot@10gen.com>2010-07-21 16:30:32 -0400
commit3bfc2c009903fa1561b1ffd4a2187b0efd70d0b0 (patch)
tree71a351f57f1531be0b7e53310fad96d30f8df787 /client
parent282978081b7102907298c96d358bf51d29c24cd0 (diff)
downloadmongo-3bfc2c009903fa1561b1ffd4a2187b0efd70d0b0.tar.gz
findOne now takes const Query&
Diffstat (limited to 'client')
-rw-r--r--client/dbclient.cpp4
-rw-r--r--client/dbclient.h4
-rw-r--r--client/syncclusterconnection.cpp2
-rw-r--r--client/syncclusterconnection.h2
4 files changed, 6 insertions, 6 deletions
diff --git a/client/dbclient.cpp b/client/dbclient.cpp
index 75be8dd41d6..a8210ce629b 100644
--- a/client/dbclient.cpp
+++ b/client/dbclient.cpp
@@ -492,7 +492,7 @@ namespace mongo {
return DBClientBase::auth(dbname, username, password.c_str(), errmsg, false);
}
- BSONObj DBClientInterface::findOne(const string &ns, Query query, const BSONObj *fieldsToReturn, int queryOptions) {
+ BSONObj DBClientInterface::findOne(const string &ns, const Query& query, const BSONObj *fieldsToReturn, int queryOptions) {
auto_ptr<DBClientCursor> c =
this->query(ns, query, 1, 0, fieldsToReturn, queryOptions);
@@ -1021,7 +1021,7 @@ namespace mongo {
return checkMaster().query(a,b,c,d,e,f,g);
}
- BSONObj DBClientPaired::findOne(const string &a, Query b, const BSONObj *c, int d) {
+ BSONObj DBClientPaired::findOne(const string &a, const Query& b, const BSONObj *c, int d) {
return checkMaster().findOne(a,b,c,d);
}
diff --git a/client/dbclient.h b/client/dbclient.h
index 39a2753e0e1..e5e2ea0b5fc 100644
--- a/client/dbclient.h
+++ b/client/dbclient.h
@@ -330,7 +330,7 @@ namespace mongo {
@return a single object that matches the query. if none do, then the object is empty
@throws AssertionException
*/
- virtual BSONObj findOne(const string &ns, Query query, const BSONObj *fieldsToReturn = 0, int queryOptions = 0);
+ virtual BSONObj findOne(const string &ns, const Query& query, const BSONObj *fieldsToReturn = 0, int queryOptions = 0);
};
@@ -894,7 +894,7 @@ namespace mongo {
/** throws userassertion "no master found" */
virtual
- BSONObj findOne(const string &ns, Query query, const BSONObj *fieldsToReturn = 0, int queryOptions = 0);
+ BSONObj findOne(const string &ns, const Query& query, const BSONObj *fieldsToReturn = 0, int queryOptions = 0);
/** insert */
virtual void insert( const string &ns , BSONObj obj ) {
diff --git a/client/syncclusterconnection.cpp b/client/syncclusterconnection.cpp
index f32586bdc28..5324b6cef13 100644
--- a/client/syncclusterconnection.cpp
+++ b/client/syncclusterconnection.cpp
@@ -153,7 +153,7 @@ namespace mongo {
return _conns[0]->callRead( toSend , response );
}
- BSONObj SyncClusterConnection::findOne(const string &ns, Query query, const BSONObj *fieldsToReturn, int queryOptions) {
+ BSONObj SyncClusterConnection::findOne(const string &ns, const Query& query, const BSONObj *fieldsToReturn, int queryOptions) {
if ( ns.find( ".$cmd" ) != string::npos ){
string cmdName = query.obj.firstElement().fieldName();
diff --git a/client/syncclusterconnection.h b/client/syncclusterconnection.h
index 9b0974c06c6..eb7ca184cd1 100644
--- a/client/syncclusterconnection.h
+++ b/client/syncclusterconnection.h
@@ -59,7 +59,7 @@ namespace mongo {
// --- from DBClientInterface
- virtual BSONObj findOne(const string &ns, Query query, const BSONObj *fieldsToReturn, int queryOptions);
+ virtual BSONObj findOne(const string &ns, const Query& query, const BSONObj *fieldsToReturn, int queryOptions);
virtual auto_ptr<DBClientCursor> query(const string &ns, Query query, int nToReturn, int nToSkip,
const BSONObj *fieldsToReturn, int queryOptions, int batchSize );