- [FIXED] invalid
ajv
custom validation keyword definition (ajv
started to strictly validate keyword definition objects, unfortunately it broke backward compatibility)
- [CHANGED] model option
paranoid=true
does NOT implicitly enabletimestamps
option (onlydeleted_at
property is considered indstead of additional propertiescreated_at
&updated_at
) - [ADDED] a new Model instance method
isDirty()
- [CHANGED] dropped support for build-in custom Model schema format which has been replaced with
json-schema
validation provided byAjv
package - [CHANGED]
Instance.prototype.sanitize
does not accept any options - [BUGFIX] When Model's instance method was overriden with user defined function, the function was being called with incorrect context object
- [CHANGED]
Document
methodsinsert
&replace
&remove
&touch
returns resolved promise with self (Document object) when operation succeeds - [BUGFIX]
Model.prototype.unlock
was not acceptingcas
argument thus the unlock operation could not succeed - [ADDED]
Instance.prototype.touch
which operates on all reference documents in addition to the main document - [ADDED] new public method
Instance.prototype.getRefDocs
which has been part of private API - [CHANGED]
Instance.prototype.update
method behaves as one would expect, that is, its syntax sugar forinstance.setData()
followed byinstance.save()
. This also fixes the method design issue which broke update hooks. - [BUGFIX]
storageAdapter
methods should always clone receivedoptions
object as nativecouchbase
sdk does not do that and we need to be sure options objects are not shared and mutated between individual operations - [REMOVED] unused
debug
module dependency - [BUGFIX] updated
bluebird
module dependency
- [REMOVED] support for callback based hook listeners. All async hook listeners are expected to return a Promise
- [BUGFIX] corner case with Model definition which has Model association defined as it's root data type - association data was being incorrectly serialized when saving to a bucket
- [BUGFIX] the
toJSON
method onModel's Instance
object was failing to throw anInstanceError
in case you tried to convert model with primitive root data type to JSON - [BUGFIX] the
caseSensitive
option onKey
object was being owerwritten bytrue
boolean - [BUGFIX] default Model's property values of Array type are cloned before they are applied to a model instance
- [BUGFIX] the
Model.build
method should initialize instance's associations before data sanitization/validation - [CHANGED]
Instance.cloneData
method has been made part of private (renamed toInstance._cloneData
) - [CHANGED]
Instance.destroy
&Instance.update
methods will return rejected promise with anInstanceError
when calling the methods on a Model instance object with nocas
value set (the operation can be forced by theforce=true
) - [CHANGED] format of the second argument of the
Model.buildKey
method has changed. The method acceptsoptions
object instead of boolean argument - [CHANGED] the
afterFailedIndexRemoval
hook type is triggered not just forStorageError
but also for any other error that occurs while removing outdated reference document indexes - [CHANGED] defined default values are always applied when creating new Instance via
Model.build
method - [CHANGED] the
Model.build
method does not clone data values passed to it anymore - [CHANGED]
Model.getById
andModel.getByRefDoc
methods returns resolved promise with thenull
value when a document is not found in a bucket - [CHANGED]
Model.getMulti
method always returns resolved promise - [ADDED] new
skipInternalProperties
option to the Instance.sanitize method - [ADDED] support for defining default array item values in a schema definition
- [ADDED] new
Instance.populate
method - handles loading of Model's associations - [ADDED] new
Model.getByIdOrFail
which returns rejected promise withStorageError
when a document is not found in a bucket - [ADDED] new
Model.buildRefDocKey
method (Model's private method_buildRefDocKey
has been updated and made public) - [ADDED] new
getByRefDocOrFail
method for every defined refDoc index. The method returns rejected promise withStorageError
when a document is not found in a bucket - [ADDED] new
lean
option toModel
"getByRefDoc" methods - if true, the method returns document'sKey
object instead of fetched document's data - [ADDED] new
refDocKey
Model option which allows us to provide custom constructor object used for generating reference document keys - [ADDED] new
key
option toModel.create
method which can be anKey
object orid
string value - [ADDED] new
Model.exists
method - [ADDED] new
indexed
option toModel.getMulti
method which if false, causes method to return an Array instead of Object (default=true) - [BUGFIX] Model's
update
instance method did recursive merge with provided data on data being updated, now, object's properties are overridden by assignment. - [BUGFIX] Model's
update
method works on Models with primitive root data structures - [ADDED] new
EMBEDDED
Model association relation type
- [BUGFIX] - Default values of an object type should be cloned before they are assigned to an
Instance
- [BUGFIX] -
Model.getById
was throwing synchronous exeption when building of document'sKey
object failed. See #12 - [BUGFIX] - Setting Model's association default value on schema definition property of
Complex
type was throwing unexpectedValidationError
/TypeError
. See #19 - [BUGFIX] - It was not possible to update
refDoc
index of already persistedInstance
with no index value present yet. See #15 - [BUGFIX] - Semantic error -
Instance.update
method was trowing "Cannot read property '_buildRefDocument' of null". See #14
- [BUGFIX] - ModelManager throws
ModelManagerError
&ModelNotFoundError
instead of genericError
object - [BUGFIX] - Model "getByRefDoc" methods ignored provided options object
- [BUGFIX] -
expiry
option was ignored inModel.touch
method - [BUGFIX] - documentation clarifications
- [BUGFIX] a
refDoc
with compoundRefDocKey
was not found when searching a document because of invalid refDoc key generation - [BUGFIX] Instance
isNewRecord
option was not set on constructor call - [BUGFIX] deleted_at schema property should be set as "not required" for a Model with
paranoid=true
option - [BUGFIX]
afterFailedRollback
hook is called with actual error which caused the rollback process to fail - [BUGFIX] fixed incorrect determination whether asynchronous hook function has defined callback fn or it returns a Promise.
- [BUGFIX] validation of REQUIRED schema properties did not fail when the properties were not defined in data being validated
- [BUGFIX] bucket object option on a Model definition should overwrite definition on
CouchbaseODM
object - [BUGFIX] fixed reference error when single hook function is being registered on
CouchbaseODM
object - [ADDED]
beforeCreate
,afterCreate
,beforeUpdate
,afterUpdate
,beforeGet
,afterGet
,beforeDestroy
,afterDestroy
hook functions are givenoptions
object argument with which a storage method was called - [ADDED] unit tests for top level
CouchbaseODM
object - [ADDED] CouchbaseODM now accepts a
bucket
object from externalcouchbase sdk
module. Till now abucket
object could be created only withkouchbase-odm/node_modules/couchbase
sdk
- mainly repository/npm setup
- mainly repository/npm setup
- mainly repository/npm setup