Example usage for Java com.mongodb.client MongoDatabase fields, constructors, methods, implement or subclass
The text is from its open source code.
void | createCollection(String collectionName) Create a new collection with the given name. |
void | createCollection(String collectionName, CreateCollectionOptions createCollectionOptions) Create a new collection with the selected options |
void | createCollection(ClientSession clientSession, String collectionName) Create a new collection with the given name. |
void | drop() Drops this database. |
MongoCollection | getCollection(String collectionName) Gets a collection. |
MongoCollection | getCollection(String collectionName, Class Gets a collection, with a specific default document class. |
String | getName() Gets the name of the database. |
MongoIterable | listCollectionNames() Gets the names of all the collections in this database. |
ListCollectionsIterable | listCollections() Finds all the collections in this database. |
Document | runCommand(Bson command) Executes the given command in the context of the current database with a read preference of ReadPreference#primary() . |
Document | runCommand(Bson command, ReadPreference readPreference) Executes the given command in the context of the current database with the given read preference. |
TResult | runCommand(Bson command, Class Executes the given command in the context of the current database with a read preference of ReadPreference#primary() . |
Document | runCommand(ClientSession clientSession, Bson command) Executes the given command in the context of the current database with a read preference of ReadPreference#primary() . |