foreach db mongodb
// Switch to admin database and get list of databases.
db = db.getSiblingDB("admin");
dbs = db.runCommand({ "listDatabases": 1 }).databases;
// Iterate through each database and get its collections.
dbs.forEach(function(database) {
db = db.getSiblingDB(database.name);
cols = db.getCollectionNames();
// Iterate through each collection.
cols.forEach(function(col) {
// Do something with each collection.
print(col);
});
});
Also in JavaScript:
- javascript pipe async functions
- javascript array spiral
- Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.
- javascript clone object
- conflict paypal api javascript with user agent Mozilla/5.0 Google
- jalali moment get milisocnds
- select elements id like jquery
- javascript array push method
- how to access nested objects in javascript
- remove header from certain pages react navigation
- react native elevation
- split a message js
- radio unchecked
- javascript swap array elements
- javascript add text to li
- get value in tag with id JS
- sleeping in js
- nodejs config file
- foreach break js
- apply event listener on id but why not style
- javascript object
- javjquery is emptyobject
- build angular project
- devexpress gridview add new row without datasource