We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have a schema which defines an array like this:
'myArray': { 'type': Array, }, 'myArray.$': { 'type': Date, },
I'm trying to remove an element from the end of the array like this:
MyCollection.update({ _id }, { $pop: { myArray: 1 }})
This gives a server error:
MongoError: Expected a number in: myArray:
If I bypass Collection 2 like this, the operation succeeds:
MyCollection.update({ _id }, { $pop: { myArray: 1 }}, { 'bypassCollection2': true })
So it looks like there is some bug with collection2 and the $pop operation on arrays?
The text was updated successfully, but these errors were encountered:
I believe the culprit is this line in simpl-schema where it cleans $pop operator fields and thus changes 1 to a date.
So, I did a little more digging and found out that the typeValidator returns an error so it gets converted to its respective value which is a date.
Sorry, something went wrong.
🤞 😬
No branches or pull requests
I have a schema which defines an array like this:
I'm trying to remove an element from the end of the array like this:
MyCollection.update({ _id }, { $pop: { myArray: 1 }})
This gives a server error:
MongoError: Expected a number in: myArray:
If I bypass Collection 2 like this, the operation succeeds:
MyCollection.update({ _id }, { $pop: { myArray: 1 }}, { 'bypassCollection2': true })
So it looks like there is some bug with collection2 and the $pop operation on arrays?
The text was updated successfully, but these errors were encountered: