Getting started
Installing
Blini is an npm module, so to install it you do:
Importing
Once you've install it, you'll need to import it.
Create a connection to MongoDB
The first step
In addition to loading the module, you need to give Blini a connection to work with. Without it, Blini can't access the database.
The connection doesn't require to be initialized, it'll be established as soon as database operations are required.
Create a schema
A schema describe the structure of the documents. It is basically a map of field name to Type
.
Follow the "Create a Schema" guide to get more insight on how schemas work.
Create a new document model
Once the data schema is defined, the next step is to create the model which store operations around the database for a schema.
Create new documents
Using the document model, we can initialize new document instances and populate the database:
Query the collection
Querying documents from the database and update it:
Last updated