Horje
working with multiple db in single query mongodb Code Example
working with multiple db in single query mongodb
// Switch to admin database and get list of databases.
db = db.getSiblingDB("admin");
dbs = db.runCommand({ "listDatabases": 1 }).databases;

// Iterate through each database.
dbs.forEach(function(database) {
    db = db.getSiblingDB(database.name);

    // Get the Group collection
    collection = db.getCollection("Group");

    // Iterate through all documents in collection.
    /*
        collection.find().forEach(function(doc) {

            // Print the meldingId field.
            print(doc.meldingId);
        });
    */

    var meldingIds = collection.distinct('meldingId');
    print(meldingIds);

});




Javascript

Related
banking program deposit and withdrawal using ajax call Code Example banking program deposit and withdrawal using ajax call Code Example
js multiple url fetch Code Example js multiple url fetch Code Example
js draw box Code Example js draw box Code Example
how to convert variable to string in jquery Code Example how to convert variable to string in jquery Code Example
how to style svgs in react Code Example how to style svgs in react Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8