Guest User

Untitled

a guest
Jun 21st, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. {
  2. itemList:[
  3. {id:20,num:12},
  4. {id:1,num:10},
  5. {id:2,num:12},
  6. {id:12,num:12}],
  7. flowerId:0
  8. }
  9.  
  10. db.getCollection('test').update({flowerId:0},
  11. {$inc:{"itemList.$[elem1].num":-2},$inc:{"itemList.$[elem2].num":-3}},
  12. {arrayFilters:[{"elem1.id":1},{"elem2.id":2}]}
  13. )
  14.  
  15. No array filter found for identifier 'elem2' in path 'itemList.$[elem2].num'
Add Comment
Please, Sign In to add comment