summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2011-03-04 16:56:33 -0500
committerEliot Horowitz <eliot@10gen.com>2011-03-04 16:56:33 -0500
commitcf1b25029ecbab3bf8b8fab3a7fa2963834060fd (patch)
treebe0501af2b96d946b5b883b09e0cb49eb9b9738b /tools
parent204fe41b71491408589dd8abff7eb04efa68456e (diff)
downloadmongo-cf1b25029ecbab3bf8b8fab3a7fa2963834060fd.tar.gz
if you specify -d local -c oplog.$main should dump
Diffstat (limited to 'tools')
-rw-r--r--tools/dump.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/dump.cpp b/tools/dump.cpp
index c2f7d274c97..8bfad78c0cd 100644
--- a/tools/dump.cpp
+++ b/tools/dump.cpp
@@ -113,10 +113,14 @@ public:
auto_ptr<DBClientCursor> cursor = conn( true ).query( sns.c_str() , Query() , 0 , 0 , 0 , QueryOption_SlaveOk | QueryOption_NoCursorTimeout );
while ( cursor->more() ) {
BSONObj obj = cursor->nextSafe();
- if ( obj.toString().find( ".$" ) != string::npos )
+ const string name = obj.getField( "name" ).valuestr();
+
+ // skip namespaces with $ in them only if we don't specify a collection to dump
+ if ( _coll == "*" && name.find( ".$" ) != string::npos ) {
+ log(1) << "\tskipping collection: " << name << endl;
continue;
+ }
- const string name = obj.getField( "name" ).valuestr();
const string filename = name.substr( db.size() + 1 );
if ( _coll != "*" && db + "." + _coll != name && _coll != name )