-
-
Notifications
You must be signed in to change notification settings - Fork 108
Using the all positional operator $[] in nested arrays causes an error #407
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
Comments
Again, it's related to simple-schema. There's a way to make it pass which is to remove the The error happens at this line. Basically it searches for key named I'm wondering though how can you use the positional operator when you're coupling it with position and each?? According to the documentation using positional operator set the value for all values.
So what's the use for $each and $position in your example here? |
Since this is primarily an issue with simpl-schema I'm going to close this issue. If you feel that it is something that we can deal with here or the situation changes, please re-open this issue. |
While I've not read too deep into it but this PR may alleviate the problem you're facing guys. |
Just came across this problem. Being able to adress multiple array items is actually quite important. Has this been fixed in |
Hi, I don't know if this is a bug in simple schema or if I'm doing something wrong.
I have a nested array like this:
My schema is like this:
And I am updating the array like this:
This inserts the new values [3,2,3] into each child array at position 2, as per the docs.
(I'm using this form because I'm performing multiple updates in one operation, but I've left out the other updates from this example.)
When I run the code I see this error:
Exception ...{ Error: myGrid.$[] is not allowed by the schema (myGrid.$[])
If I bypass Collection2 like this, the operation succeeds:
MyCollection.update({ _id }, update, { 'bypassCollection2': true });
Is there a way to make this operation pass the schema? Or is it a bug? Thank you.
The text was updated successfully, but these errors were encountered: