Package io.realm.mongodb.mongo
Class MongoDatabase
- java.lang.Object
-
- io.realm.mongodb.mongo.MongoDatabase
-
public class MongoDatabase extends Object
The RemoteMongoDatabase provides access to itsDocument
MongoCollection
s.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MongoCollection<Document>
getCollection(String collectionName)
Gets a collection.<DocumentT>
MongoCollection<DocumentT>getCollection(String collectionName, Class<DocumentT> documentClass)
Gets a collection, with a specific default document class.String
getName()
Gets the name of the database.
-
-
-
Method Detail
-
getName
public String getName()
Gets the name of the database.- Returns:
- the database name
-
getCollection
public MongoCollection<Document> getCollection(String collectionName)
Gets a collection.- Parameters:
collectionName
- the name of the collection to return- Returns:
- the collection
-
getCollection
public <DocumentT> MongoCollection<DocumentT> getCollection(String collectionName, Class<DocumentT> documentClass)
Gets a collection, with a specific default document class.- Type Parameters:
DocumentT
- the type of the class to use instead ofDocument
.- Parameters:
collectionName
- the name of the collection to returndocumentClass
- the default class to cast any documents returned from the database into.- Returns:
- the collection
-
-