Started docs for model, changelog

This commit is contained in:
Anatoliy Chakkaev 2013-03-25 01:22:50 +04:00
parent 13e046ed09
commit cee7029445
2 changed files with 34 additions and 1 deletions

View File

@ -5,7 +5,7 @@ jugglingdb-changelog(3) - The History of JugglingDB
### upcoming release
* Documentation in web and man
* Documentation in [web][http://jugglingdb.co] and man
### 0.2.1

View File

@ -7,6 +7,39 @@ This section describes common methods of models managed by jugglingdb and
explains some model internals, such as data representation, setters, getters and
virtual attributes.
## ESSENTIALS
### Default values
## DB WRITE METHODS
### Model.create([data[, callback]])
Create instance of Model with given data and save to database, invoke callback
when ready. Callback accepts two arguments: error and model instance.
### Model.updateAttributes(data[, callback]);
### Model.updateAttributes(data[, callback]);
## DB READ METHODS
### Model.all([params[, callback]])
Find all instances of Model, matched by query. Fields used for filter and sort
should be declared with `{index: true}` in model definition.
* `param`:
* where: Object `{ key: val, key2: {gt: 'val2'}}`
* include: String, Object or Array. See AbstractClass.include documentation.
* order: String
* limit: Number
* skip: Number
* `callback`:
Accepts two arguments:
* err (null or Error)
* Array of instances
## SEE ALSO
jugglingdb-schema(3)