add example of the variation of remove method

This commit is contained in:
Eddie Lau
2014-04-03 13:13:08 +08:00
parent 95baed676d
commit 7f4a0e98f9

View File

@@ -490,7 +490,7 @@ Use the `all` method to find lots of items. Pass it a set of query parameters in
- `query [object]`: if the query is an object, it will be interpreted as a Query object
##### options
- `sort [object]`: each key is a property name, each value can either be `asc` or `desc`.
- `sort [object]`: each key is a property name, each value can either be `asc` or `desc`.
- `includes [array]`: Using SQL adapters, you may supply an array of model association names to eager-load.
##### example
@@ -527,6 +527,20 @@ User.remove('abc-123', function (err, data) {
});
```
`remove(condition, fn)`
Remove instances from the database by condition
##### condition
- `condition [object]`: the key value condition of instances to be removed
##### examples
```
User.remove({state: "inactive"}, function (err, data) {
// do something now that it's removed.
});
```
* * *
#### queries