Closed gwhobbs closed 3 years ago
Does not work with MongoDB $[] positional insert/update operator, which updates all array matches starting in version 3.6.
$[]
To Reproduce
Steps to reproduce the behavior:
actions.$[].completed is not allowed by the schema
Concrete example: mark all actions, stored in array on a MongoDB doc, as completed.
Relevant section of schema:
{ ..., actions: { type: Array, optional: true }, 'actions.$': { type: Object, blackbox: true }, }
Query:
Actors.update({ 'actions.name': { $exists: 1 } }, { $set: { 'actions.$[].completed': true } })
Expected behavior
Every object in the actions array that has a name gets marked as completed.
Additional context
The $ positional operator works properly, but the $[] operator does not.
$
Found existing issue #407
Does not work with MongoDB
$[]
positional insert/update operator, which updates all array matches starting in version 3.6.To Reproduce
Steps to reproduce the behavior:
$[]
positional operatoractions.$[].completed is not allowed by the schema
Concrete example: mark all actions, stored in array on a MongoDB doc, as completed.
Relevant section of schema:
Query:
Expected behavior
Every object in the actions array that has a name gets marked as completed.
Additional context
The
$
positional operator works properly, but the$[]
operator does not.