Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. projects: [
  2. {
  3. type: Schema.Types.ObjectId,
  4. ref: 'Project'
  5. }
  6. ]
  7.  
  8. const client = await Client.updateOne(
  9. { _id: req.body.client_id },
  10. {
  11. $pullAll: { projects: [req.body.project_id] }
  12. }
  13. );
  14.  
  15. const client = await Client.updateOne(
  16. { _id: req.body.client_id },
  17. {
  18. $pullAll: { projects: req.body.project_id }
  19. }
  20. );
  21.  
  22. const client = await Client.updateOne(
  23. { _id: req.body.client_id },
  24. {
  25. $pullAll: { projects: { $in: [ req.body.project_id ] } }
  26. }
  27. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement