Tag Archives: getSiblingDB

MongoDB -Access different databases and Collections

You can use db.getSiblingDB() method to access another database without switching the database. To List Collections of PP database and query collection named “restaurants” db.getSiblingDB(‘PP’).getCollectionNames() The PP Database has three collections first restaurants second Accessing PP database temporarily from Test … Continue reading

Posted in MongoDB | Tagged , , , , , , | Leave a comment