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:
parent
8f373bf1d4
commit
fac2ee626f
@ -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);
|
||||
|
1
db/rec.h
1
db/rec.h
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user