The Db
object in the MongoDB driver provides access to databases. It acts as a representation of the database, allowing you to do things like connect, add users, access collections, etc. You use Db
objects to gain and maintain access to databases that you are interacting with in MongoDB.
A Db
object is typically created when you connect to the database, as described in the previous section. Table 13.5 lists the methods you can call on a Db
object.