Painting Blue Code
Simple, self-explanatory code snippets.
2015-08-13
MongoDB - How to list all collections
db.getCollectionNames();
// This gets only the first found collection
db.getCollectionNames()[1];
// This ignores the system collection called "system.indexes"
db.getCollectionNames().filter(function(x){return x!=='system.indexes'});
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment