public class MongoDatabase extends Object
Document MongoCollections.| Modifier and Type | Method and Description |
|---|---|
MongoCollection<Document> |
getCollection(String collectionName)
Gets a collection.
|
<DocumentT> |
getCollection(String collectionName,
Class<DocumentT> documentClass)
Gets a collection, with a specific default document class.
|
String |
getName()
Gets the name of the database.
|
public String getName()
public MongoCollection<Document> getCollection(String collectionName)
collectionName - the name of the collection to returnpublic <DocumentT> MongoCollection<DocumentT> getCollection(String collectionName, Class<DocumentT> documentClass)
DocumentT - the type of the class to use instead of Document.collectionName - the name of the collection to returndocumentClass - the default class to cast any documents returned from the database into.