I have a document with this structure:
{
codeId: 1,
generatedCodes: [
{
name: 'Code 1',
status: 'In Progress'
},
{
name: 'Code 2',
status: 'In Progress'
},
{
name: 'Code 3',
status: 'In Progress'
}
]
}
I'm trying to update the status property of each object by using the following code:
db.codes.update({codeId: id}, {$set: {'generatedCodes.$[].status': 'Validated'}}, {multi: true})
But none of the array items get the new status...
ididis correct ... there must be something else I'm missingdb.adminCommand( { setFeatureCompatibilityVersion: "3.6" } ).