The property allows developers to specify that the default value
should be retrieved via a named function.
Only two built-in functions are supported at the moment:
"guid", "uuid" - generate a new GUID/UUID
"now" - use the current date and time
Support for custom (user-provided) functions is not implemented yet.
Support both promise and callback styles in
ModelBaseClass.notifyObserversOf.
When there is no callback supplied, the method returns a promise that
is resolved (or rejected) with the result.
* Add an optional `options` argument to all CRUD methods (Raymond Feng)
* Upgrade deps (Raymond Feng)
* Remove workaround for perfomance degradation (Denis Bardadym)
* Change equal to eql to support mongodb ObjectID (Raymond Feng)
* Enhance the coercion for boolean/date types (Raymond Feng)
* Make sure base properties/settings are merged into the submodel (Raymond Feng)
* support optimized findOrCreate (Clark Wang)
* Fix the perf around should.not.equal for complex objects (Raymond Feng)
* testcase for #420 (Andrey Loukhnov)
* use findOrCreate in hasOne#create (Clark Wang)
* Create model foreign key matching type of opposite part of relation (even if it has a custom field type) (Andrey Loukhnov)
* minor formatting issues (trailing spaces and such) and .editorconfig (Andrey Loukhnov)
Signed-off-by: Clark Wang <clark.wangs@gmail.com>
remove undefined for creating data in findOrCreate
Signed-off-by: Clark Wang <clark.wangs@gmail.com>
getLastGeneratedUid instead of force an id
Signed-off-by: Clark Wang <clark.wangs@gmail.com>
2.16.0
* Return 400 when client provides an incorrect value (Pradnya Baviskar)
* Relax "id" checks in test/manipulation.test.js (Miroslav Bajtoš)
* Fix typo (Raymond Feng)
* test: undefined property values are preserved (Miroslav Bajtoš)
* Remove undefined properties for create (Raymond Feng)
* Update to `should` to the latest version 4.6.3 (Miroslav Bajtoš)
* Relax the id equality test for mongodb object ids (Raymond Feng)
So hasOne#create could take advantage from optimized findOrCreate,
which can avoid multiple creation among concurrent requests.
Signed-off-by: Clark Wang <clark.wangs@gmail.com>
2.15.0
* Fix id type issue for update (Raymond Feng)
* Rename hook "query" to "access" (Miroslav Bajtoš)
* Implement intent hook `before delete` (Miroslav Bajtoš)
* Remove redundant `.toObject()` call from `upsert` (Miroslav Bajtoš)
* Fix regression in `.save()` from 1fd6eff1 (Miroslav Bajtoš)
* Fix hasOne remoting (Raymond Feng)
* Make sure batch create calls back with correct data (Raymond Feng)
* Intent-based hooks for persistence (Miroslav Bajtoš)
* ModelBaseClass: implement async observe/notify (Miroslav Bajtoš)
* Upgrade `should` to the latest 1.x version (Miroslav Bajtoš)
* Fixed nullCheck in validations to correct behavior when dealing with undefined attributes (James Billingham)
* Supply target to applyProperties function (Fabien Franzen)
* fix id property for composite ids (Clark Wang)
* fix id properties should sort by its index (Clark Wang)
* Fixed typos and logic for protected properties (Christian Enevoldsen)
* adds support for protected properties. (Christian Enevoldsen)
* support embeds data for belongsTo relation Signed-off-by: Clark Wang <clark.wangs@gmail.com> (Clark Wang)