-
Notifications
You must be signed in to change notification settings - Fork 265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attribute update operators (inc, push, etc.) #3814
Comments
The following operators will be taken into account:
Examples follow:
(
(
|
Implementation notes: From the point of view of the update, it seems pretty simple: just to "pass through" the operation to the corresponding MongoDB operator at update() time. Things get tricky when notification enter into play, as with the current approach we would need to do the operation in memory in parallel to the modification done at MongoDB. This is easy for some operations (eg. However, weird things may occur if several CB are in parallel. For instance, CB A and B, attribute being X=1 in MongoDB. Two updates occur, one with $inc:1 at CB A and other $inc:2 in CB B. Depending on timing several things may occur:
This should be warmed at documentation. As alternative we can disable notification of these attributes or, at least, allow disabling them by parametrization ( |
Implementation would be split in (at least) two PRs:
|
First PR #3814 |
The |
Second PR #3954 |
Also related PR #4009 with two new operators ( |
This issue is about implementing advanced update operators for attributes, beyond the current "set value". For instance "increment attribute value by 1" or "remove the last element of an attribute array".
Taking into account we use MongoDB as DB, a good strategy will be to support all the update operators supported by MongoDB, described at https://docs.mongodb.com/manual/reference/operator/update/. We should do it in a smart way, so if MongoDB adds a new operator in a new release, it would be easy to support it also in the CB.
The text was updated successfully, but these errors were encountered: