You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.
When calling instance.save() on an existing record, CouchDB returns a 409 Document update conflict when the model definition has the strict property set to true. It appears that BaseModel.applyProperties(data, instance) removes the _rev property because it isn't defined in the model.
I think the fix for this is figuring out a way for the DataSource to somehow inject any attached models with a hidden property to hold the _rev, because otherwise the default loopback functionality will automatically discard it. I'll look into this more as I'm able to find time.
For now, a workaround seems to be either manually adding _rev to the model's properties, and then setting _rev as a hidden property (i.e. hidden: ['_rev']), or just setting strict:false.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When calling
instance.save()
on an existing record, CouchDB returns a409 Document update conflict
when the model definition has thestrict
property set totrue
. It appears thatBaseModel.applyProperties(data, instance)
removes the_rev
property because it isn't defined in the model.I think the fix for this is figuring out a way for the DataSource to somehow inject any attached models with a hidden property to hold the
_rev
, because otherwise the default loopback functionality will automatically discard it. I'll look into this more as I'm able to find time.For now, a workaround seems to be either manually adding
_rev
to the model's properties, and then setting_rev
as a hidden property (i.e.hidden: ['_rev']
), or just settingstrict:false
.The text was updated successfully, but these errors were encountered: