0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

mamke getCollectionNames() in the shell prettier

overlogging
This commit is contained in:
Dwight 2009-02-03 14:42:53 -05:00
parent 8f373bf1d4
commit fac2ee626f
4 changed files with 8 additions and 5 deletions

View File

@ -1033,8 +1033,8 @@ namespace mongo {
memcpy(r->data+4, &idToInsert, sizeof(idToInsert));
memcpy(r->data+4+sizeof(idToInsert), ((char *)obuf)+4, addID-4);
// TEMP:
BSONObj foo(r->data);
cout << "TEMP:" << foo.toString() << endl;
// BSONObj foo(r->data);
// cout << "TEMP:" << foo.toString() << endl;
}
else {
memcpy(r->data, obuf, len);

View File

@ -6,6 +6,7 @@
_ multiple files, not just indexes.dat
_ lazier writes?
_ configurable cache size
_ fix on abnormal terminations to be able to restart some
*/
#pragma once

View File

@ -304,7 +304,7 @@ DB.prototype.getCollectionNames = function(){
var nsLength = this._name.length + 1;
this.getCollection( "system.namespaces" ).find().forEach(
this.getCollection( "system.namespaces" ).find().sort({name:1}).forEach(
function(z){
var name = z.name;

View File

@ -200,8 +200,10 @@ shellHelper.show = function( what ){
if ( what == "users" )
return db.system.users.find();
if ( what == "collections" || what == "tables" )
return db.getCollectionNames();
if ( what == "collections" || what == "tables" ) {
db.getCollectionNames().forEach( function(x){print(x)} );
return "";
}
if ( what == "dbs" )
return db.getMongo().getDBNames();