showing results for - "mongodb check if collection exists"
Natan
01 Jun 2020
1db.collectionNames(collName, function(err, names) {
2    console.log('Exists: ', names.length > 0);
3});
4
5// MongoDB 2.x:
6db.listCollections({name: collName})
7    .next(function(err, collinfo) {
8        if (collinfo) {
9            // The collection exists
10        }
11    });
queries leading to this page
how to check if a document exists in a mongo db collectionmongodb check if collection exists pythoncheck for existence of collection in mongodbmongodb how to check if certain element exists in collection or emptymongodb php check if collection existsmongodb test collection exist notmongodb check if collection exist and createhow to check if collection data exists in mongodbcheck if collection exists in mongodbcheck if collection exists mongodb nodejspymongo check if collection existsmongodb collection check exitshow to check if collection exists mongomongodb collection existsmongodb check collection existspymongo if collection existshow to check if mongodb has collection existsmongodb how to check if certain element exists in collectionget if collection exists mongodbmongodb check collection field existscheck if collectoin exists in mongodbcheck exist mongodbmongodb check if collection existcheck collection exists mongooperationsnode mongodb check if collection existscommand to check existence of collection in mongodbjava mongodb check if collection existsmongodb does collection exitsmongodb check if id exists in a collectionnodejs mongodb check collection existspymongo check if a db collection existscheck if collection exists mongodbdb collection exist mongodbhow to check if collection exists in mongodbhow to find whether a document exist in collection mongodbmongodb check if collection existsnode js mongodb check if collection existscheck if collection exists mongodb jsmongodb test collection existscheck whether a collection exists or not in mongodbmongodb shell check if collection existshow to check if a collection is present in mongodbmongodb does collection existmongo client check if collection exists or notpymongo check collection exist or notmongo db check if collection exists jsmongodb check if collection exists