mirror of
https://github.com/CryptKeeperZK/ejs.git
synced 2026-01-09 07:27:56 -05:00
add example of the variation of remove method
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user