george koller
george koller

Reputation: 3941

Using Mongo_Dart how to get lists of database-names, and collections (given db)

In the shell I can do this: show dbs to list all 'databases' on the connection. How can I do this using mongo_dart commands?

In the shell I can do this: show collections (names) on a given database. How can I do this using mongo_dart commands?

I'm stumped, thanks!

Upvotes: 2

Views: 343

Answers (2)

Vadim Tsushko
Vadim Tsushko

Reputation: 1516

I've just added two helpers to Db class: listDatabases() and listCollections() Both return Future<List<String>>, hopefully that would be usefull to you. Effective in v0.1.40

Upvotes: 1

Rastislav Lamoš
Rastislav Lamoš

Reputation: 183

After some googling and looking at the mongo_dart API and examples I came to the conclusion that it is currently not possible to do such thing with this library.

Upvotes: 1

Related Questions