Java com.mongodb.client MongoDatabase fields, constructors, methods, implement or subclass

Example usage for Java com.mongodb.client MongoDatabase fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for com.mongodb.client MongoDatabase.

The text is from its open source code.

Method

voidcreateCollection(String collectionName)
Create a new collection with the given name.
voidcreateCollection(String collectionName, CreateCollectionOptions createCollectionOptions)
Create a new collection with the selected options
voidcreateCollection(ClientSession clientSession, String collectionName)
Create a new collection with the given name.
voiddrop()
Drops this database.
MongoCollectiongetCollection(String collectionName)
Gets a collection.
MongoCollectiongetCollection(String collectionName, Class documentClass)
Gets a collection, with a specific default document class.
StringgetName()
Gets the name of the database.
MongoIterablelistCollectionNames()
Gets the names of all the collections in this database.
ListCollectionsIterablelistCollections()
Finds all the collections in this database.
DocumentrunCommand(Bson command)
Executes the given command in the context of the current database with a read preference of ReadPreference#primary() .
DocumentrunCommand(Bson command, ReadPreference readPreference)
Executes the given command in the context of the current database with the given read preference.
TResultrunCommand(Bson command, Class resultClass)
Executes the given command in the context of the current database with a read preference of ReadPreference#primary() .
DocumentrunCommand(ClientSession clientSession, Bson command)
Executes the given command in the context of the current database with a read preference of ReadPreference#primary() .