-[FEATURE] Throw an error if no where clause is given to `Model.destroy()`.
-[BUG] Fixed issue with `order: sequelize.literal('string')`
-[BUG] Fixed issue with `order: sequelize.literal('string')`
-[FEATURE] add `clone: true` support to `.get()`. Is needed when using `delete` on values from a `.get()` (`toJSON()`, `this.values`). (.get() is just a reference to the values for performance reasons when there's no custom getters or includes)
-[FEATURE] add `clone: true` support to `.get()`. Is needed when using `delete` on values from a `.get()` (`toJSON()`, `this.values`). (.get() is just a reference to the values for performance reasons when there's no custom getters or includes)
@@ -8,6 +8,8 @@ In order to use the CLI you need to install the respective package:
...
@@ -8,6 +8,8 @@ In order to use the CLI you need to install the respective package:
$ npm install --save sequelize-cli
$ npm install --save sequelize-cli
```
```
As with any npm package, you can use the global flag (`-g`) to install the CLI globally. If you have installed the CLI without the global flag, use `node_modules/.bin/sequelize [command]` instead of `sequelize [command]`.
The CLI currently supports the following commands:
The CLI currently supports the following commands:
... the existing entry will not be changed. See the `job` of the second user, and the fact that created was false.
... the existing entry will not be changed. See the `job` of the second user, and the fact that created was false.
Notice that the success callback has two arguments. When using [promises][5] you should call `spread`[(API ref)][6] instead of `then`, since `then` will only recieve the first argument (the DAO), while `spread` will recieve both the DAO, and the `created` boolean.
### findAndCountAll - Search for multiple elements in the database, returns both data and total count
### findAndCountAll - Search for multiple elements in the database, returns both data and total count
This is a convienience method that combines`findAll()`and`count()`(see below), this is useful when dealing with queries related to pagination where you want to retrieve data with a`limit`and`offset`but also need to know the total number of records that match the query.
This is a convienience method that combines`findAll()`and`count()`(see below), this is useful when dealing with queries related to pagination where you want to retrieve data with a`limit`and`offset`but also need to know the total number of records that match the query.