Monday, 15 May 2017

How to perform a partial update in loopback mongodb connector

I would like to perform a partial update to one document to alter an array property using the updateAttributes function.

My goal is to push or pull an element of the array so I avoid concurrency issues.

At the moment all I find about using updateAttributes is by providing directly the properties to override:

document.updateAttributes({ foo: 'bar');

But nothing deal with arrays. Is there a built-in way to do this or I am going to have to implement myself?



via jbernal

No comments:

Post a Comment