Class RemoteMongoDatabaseImpl
- java.lang.Object
-
- com.mongodb.stitch.server.services.mongodb.remote.internal.RemoteMongoDatabaseImpl
-
- All Implemented Interfaces:
RemoteMongoDatabase
public final class RemoteMongoDatabaseImpl extends Object implements RemoteMongoDatabase
-
-
Method Summary
Modifier and Type Method Description RemoteMongoCollection<Document>
getCollection(String collectionName)
Gets a collection.<DocumentT>
RemoteMongoCollection<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.- Specified by:
getName
in interfaceRemoteMongoDatabase
- Returns:
- the database name
-
getCollection
public RemoteMongoCollection<Document> getCollection(String collectionName)
Gets a collection.- Specified by:
getCollection
in interfaceRemoteMongoDatabase
- Parameters:
collectionName
- the name of the collection to return- Returns:
- the collection
-
getCollection
public <DocumentT> RemoteMongoCollection<DocumentT> getCollection(String collectionName, Class<DocumentT> documentClass)
Gets a collection, with a specific default document class.- Specified by:
getCollection
in interfaceRemoteMongoDatabase
- 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
-
-