Db. Order. Update (
{title: {$regex: ^ merchandise shopping list/},
Detail: {$elemMatch: {name: "flour," price: {$lte: 30}}}},
{$inc: {" detail. Detail ": {price: 5}}},
{multi: true}
)
Error: & gt; [Error] index 0:14 - always increment with non - numeric argument: {detail. Detail: {price: 5.0}}
CodePudding user response:
Db. Order. Update ({title: {$regex: ^ merchandise shopping list/},
Detail: {$elemMatch: {name: "flour," price: {$lte: 30}}}},
{$inc: {detail: {price: 5}}},
{multi: true}
)
CodePudding user response:
Fix the db. The order. The update ({title: {$regex: ^ merchandise shopping list/},
Detail: {$elemMatch: {name: "flour," price: {$lte: 30}}}},
{$inc: {detail. $. "price" : 5}},
{multi: true}
)