modifyWithQuery({a: [{x: 1}, {x: 3}]},
    {$and: [{'a.x': 3}, {'a.x': 1}]},
    {$set: {'a.$.x': 5}},
    {a: [{x: 5}, {x: 3}]});