diff options
author | Eliot Horowitz <eliot@10gen.com> | 2011-03-04 16:56:33 -0500 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2011-03-04 16:56:33 -0500 |
commit | cf1b25029ecbab3bf8b8fab3a7fa2963834060fd (patch) | |
tree | be0501af2b96d946b5b883b09e0cb49eb9b9738b /tools | |
parent | 204fe41b71491408589dd8abff7eb04efa68456e (diff) | |
download | mongo-cf1b25029ecbab3bf8b8fab3a7fa2963834060fd.tar.gz |
if you specify -d local -c oplog.$main should dump
Diffstat (limited to 'tools')
-rw-r--r-- | tools/dump.cpp | 8 |
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 ) |