<the.jmcnet.t
...@gmail.com> wrote:
> Sorry but the listDatabases lists the "databases" and not the collections.
> Did I miss something ? Example of listDatabases return :
>> use admin
> switched to db admin
>> db.runCommand({"listDatabases":1})
> {
> "databases" : [
> {
> "name" : "test_db",
> "sizeOnDisk" : 83886080,
> "empty" : false
> },
> {
> "name" : "local",
> "sizeOnDisk" : 1,
> "empty" : true
> }
> ],
> "totalSize" : 83886080,
> "ok" : 1
> }
> Any other idea ? How does the others drivers do to getCollectionNames ?
> Thank's in advance.
> Le mercredi 17 octobre 2012 03:11:41 UTC+2, William Zola a écrit :
>> Look at the 'listDatabases' command:
>> http://docs.mongodb.org/manual/reference/command/listDatabases/
>> This is the command that all of the drivers end up calling internally.
>> -William
>> On Tuesday, October 16, 2012 2:17:38 PM UTC-7, The JMCNet Team wrote:
>>> Hi,
>>> It seems that we can do a query on system.namespaces collection.
>>> But the answer looks like :
>>> { name:db_name.system.indexes}
>>> { name:db_name.fs.files}
>>> { name:db_name.fs.files.$_id_}
>>> { name:db_name.fs.files.$filename_1_uploadDate_1}
>>> { name:db_name.fs.chunks}
>>> { name:db_name.fs.chunks.$_id_}
>>> { name:db_name.fs.chunks.$files_id_1_n_1}
>>> { name:db_name.SomeCollection}
>>> { name:db_name.SomeCollection.$_id_}
>>> So we have to filter the response. Is there a better way to get all
>>> collections of a database ?
>>> Thank's for answer.
> --
> You received this message because you are subscribed to the Google
> Groups "mongodb-user" group.
> To post to this group, send email to mongodb-user@googlegroups.com
> To unsubscribe from this group, send email to
> mongodb-user+unsubscribe@googlegroups.com
> See also the IRC channel -- freenode.net#mongodb