summaryrefslogtreecommitdiff
path: root/db/dbcommands.cpp
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-11-24 09:41:33 -0500
committerEliot Horowitz <eliot@10gen.com>2009-11-24 09:41:33 -0500
commitea24725b8e4117f0dc28b0d2b4b22cb9bbdb1f55 (patch)
tree7aaeef08c02c06a71677690f506b4db2c0b76534 /db/dbcommands.cpp
parent4e9630f5d5b613050b9a040f665b534db81ffe03 (diff)
downloadmongo-ea24725b8e4117f0dc28b0d2b4b22cb9bbdb1f55.tar.gz
some command cleaning and query for distinct SERVER-437
Diffstat (limited to 'db/dbcommands.cpp')
-rw-r--r--db/dbcommands.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/db/dbcommands.cpp b/db/dbcommands.cpp
index 17325048d1a..3617cc714e7 100644
--- a/db/dbcommands.cpp
+++ b/db/dbcommands.cpp
@@ -1169,8 +1169,8 @@ namespace mongo {
q = p["cond"].embeddedObject();
else if ( p["condition"].type() == Object )
q = p["condition"].embeddedObject();
- else if ( p["q"].type() == Object )
- q = p["q"].embeddedObject();
+ else
+ q = getQuery( p );
string ns = dbname;
ns = ns.substr( 0 , ns.size() - 4 );
@@ -1248,7 +1248,7 @@ namespace mongo {
long long size = 0;
- auto_ptr<DBClientCursor> cursor = db.query( ns , BSONObj() , 0 , 0 , &keyPattern );
+ auto_ptr<DBClientCursor> cursor = db.query( ns , getQuery( cmdObj ) , 0 , 0 , &keyPattern );
while ( cursor->more() ){
BSONObj o = cursor->next();
BSONObj value = o.extractFields( keyPattern );