Simple ODM
Simple ODM is an object-document mapper for NoSQL databases. It only supports MongoDB now.
Instrallation
To install Simple ODM:
$ npm install simple-odm --save
Get started
Schema, Model, and Driver
First, you need to create a schema:
; const schema = name: 'user' paths: account_name: required: true ;
Then, create your model class by:
- extending MongoModel class
- overridding schema getter with the schema you created
; static { return schema; };
You also need to setup a DB driver:
; mongoDriver;
Persist Data
const user = account_name: "John"; try user; catch e // Error Handling
License
MIT