MongoDB
SugoiJS predefined module for mongoDB client
Overview
SugoiJS provides mongoDB client that is based on the ORM module with all of its' abilities.
Bootstrapping
Bootstrapping is done by one line:
The connectionName
parameter is used for multiple connection.
Example
Creating a model
For creating a model, all you need to do is to extend the MongoModel
class and define your properties.
Example
Model naming
By default the model name is the class name (case sensitive).
For override the collection name, use the @ModelName
decorator
Example
Using connections
For using different connection for a model you can use setConnectionName
static method or ConnectionName
decorator.
Example
For more information enter the @sugoi/orm page
Last updated