MongoClient.getCollection

Accesses a collection using an absolute path.

The full database.collection path must be specified. To access collections using a path relative to their database, use getDatabase in conjunction with MongoDatabase.opIndex.

class MongoClient
@safe
getCollection
(
string path
)

Return Value

MongoCollection for the given combined database and collection name (path)

Examples

auto col = client.getCollection("test.collection");

Meta