const classafMongo::MongoDb
sys::Obj afMongo::MongoDb
Represents a MongoDB database.
- cmd
MongoCmd cmd(Str cmdName, Obj? cmdVal := 1)For Power Users!
Runs an arbitrary command against this database.
Don't forget to call
run()!- collection
MongoColl collection(Str collectionName)Returns a
Collectionwith the given name.Note this just instantiates the Fantom object, it does not create anything in MongoDB.
- connMgr
const MongoConnMgr connMgrThe underlying connection manager.
- drop
Drops the database. Be careful!
@see https://www.mongodb.com/docs/manual/reference/command/dropDatabase/
- get
@Operator
MongoColl get(Str collectionName)Convenience / shorthand notation for
collection(name)- listCollectionNames
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
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
new make(MongoConnMgr connMgr, Str? name := null)Creates a
Databasewith the given name.Note this just instantiates the Fantom object, it does not create anything in MongoDB.
- name
const Str nameThe name of the database.