Join us Sept 17 at .local NYC! Use code WEB50 to save 50% on tickets. Learn more >
MongoDB Event
Docs Menu
Docs Home
/ /
Atlas Device SDKs
/ / /

Class MongoDatabase

java.lang.Object
io.realm.mongodb.mongo.MongoDatabase

The RemoteMongoDatabase provides access to its Document MongoCollection s.

Modifier and Type
Method and Description
getCollection <DocumentT >(
String collectionName,
)

Gets a collection, with a specific default document class.

String collectionName
)

Gets a collection.

public String

Gets the name of the database.

  • Methods inherited from class java.lang.Object : getClass , hashCode , equals , clone , toString , notify , notifyAll , wait , wait , wait , finalize

public MongoCollection getCollection <DocumentT >(
String collectionName,
)

Gets a collection, with a specific default document class.

Type Parameters

  • DocumentT - the type of the class to use instead of Document .

Parameters

  • collectionName - the name of the collection to return

  • documentClass - the default class to cast any documents returned from the database into.

Returns

the collection

String collectionName
)

Gets a collection.

Parameters

  • collectionName - the name of the collection to return

Returns

the collection

public String getName ()

Gets the name of the database.

Returns

the database name

Back

MongoCollection

On this page