const classafMongo::MongoDb

sys::Obj
  afMongo::MongoDb

Represents a MongoDB database.

cmd

Source

MongoCmd cmd(Str cmdName, Obj? cmdVal := 1)

For Power Users!

Runs an arbitrary command against this database.

Don't forget to call run()!

collection

Source

MongoColl collection(Str collectionName)

Returns a Collection with the given name.

Note this just instantiates the Fantom object, it does not create anything in MongoDB.

connMgr

Source

const MongoConnMgr connMgr

The underlying connection manager.

drop

Source

Str:Obj? drop()

get

Source

@Operator
MongoColl get(Str collectionName)

Convenience / shorthand notation for collection(name)

listCollectionNames

Source

Str[] listCollectionNames()

Returns all the collection (and view) names in this Mongo database.

This is more optimised than just calling listCollections().

@see https://www.mongodb.com/docs/manual/reference/command/listCollections/

listCollections

Source

MongoCur listCollections([Str:Obj?]? filter := null)

Returns a list of collections and views in this database, along with some basic info.

@see https://www.mongodb.com/docs/manual/reference/command/listCollections/

make

Source

new make(MongoConnMgr connMgr, Str? name := null)

Creates a Database with the given name.

Note this just instantiates the Fantom object, it does not create anything in MongoDB.

name

Source

const Str name

The name of the database.