const mixinafMorphia::Morphia
afMorphia::Morphia
(Service) - The main entry point into Morphia.
- database
abstract Database database()
The MongoDB database this
Morphia
instance wraps. By default the database is taken from the MongoUrl.- datastore
abstract Datastore datastore(Type entityType, Database? database := null)
Returns a
Datastore
instance for the given entity type.If
database
is null, the default database from the Mongo connection url is used.- fromMongoDoc
abstract Obj fromMongoDoc(Type entityType, Str:Obj? mongoDoc)
Converts the given Mongo document to a Fantom entity instance.
Convenience for
Converters.toFantom(...)
- get
@
Operator
abstract Datastore get(Type entityType, Database? database := null)Convenience / shorthand notation for
datastore(entityType, database)
- toMongoDoc
abstract Str:Obj? toMongoDoc(Type entityType, Obj? entity)
Converts the given entity instance to a Mongo document.
Convenience for
(Str:Obj?) Converters.toMongo(...)
- note the cast.