-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
Support $[] operator in updates #378
Comments
Yeah basically all the operators that existed when the package was written are supported but there's never been an effort to add support for newer operators like I'll keep this open as an enhancement request if someone wants to make it work. |
How this field key validation can be omitted? |
@drone1 If you downvoted me - then you know how to update subdocument in array not using $[]. Could you help? |
Oops. Actually I didn’t mean to do that? I just grabbed the array and
modified it and $set it IIRC. :(
…On Sat, Jun 13, 2020 at 17:46 Al4evec ***@***.***> wrote:
@drone1 <https://github.com/drone1> If you downvoted me - then you know
how to update subdocument in array not using $[]. Could you help?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#378 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABQIEPDO3SYISZSB24IQCW3RWONM7ANCNFSM4NGH43IQ>
.
|
Got it. I'm trying to solve problems, caused by array rewriting. In parallel processes. |
Well this thread is going off the rails now but maybe look into atomicity
and transactions.
https://docs.mongodb.com/manual/core/write-operations-atomicity
…On Sat, Jun 13, 2020 at 18:00 Al4evec ***@***.***> wrote:
Got it. I'm trying to solve problems, caused by array rewriting. In
parallel processes.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#378 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABQIEPFQOI54WLHCY7QWGJDRWOPA3ANCNFSM4NGH43IQ>
.
|
Thank you. I'll look there. |
@aldeed, I might have a quick solution for supporting $[]. While trying to understand how mongodb modifiers are handled |
It would be great to be able to use the https://docs.mongodb.com/manual/reference/operator/update/positional-filtered/ |
Made a PR longshotlabs/mongo-object#12 to add support for any positional operators as described in my earlier comment |
This kind of temporary workaround. I tried and it works:
|
This appears to be an issue with simpl-schema and not Collection2, according to Meteor-Community-Packages/meteor-collection2#407.
I'm trying to use the $[] operator to update all elements in an array with 1 update() call.
This apparently fails due to a missing key in the schema:
If you go down the path of error's, after 3 or so you might end up with a few more lines in your schema, which are clearly wrong, but "fix" the issue:
Versions of stuff:
Meteor: 1.10.2
aldeed:collection2: 3.0.6
simpl-schema: 1.7.3
The text was updated successfully, but these errors were encountered: