Docs Menu
Docs Home
/ /
Atlas Device SDKs
/ / /

Class MongoDatabase

On this page

  • io.realm.mongodb.mongo
  • Method Summary
  • Inherited Methods
  • Method Detail
  • getCollection
  • getName
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