Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. var findBy = {
  2. _id : bWYqm6-Oo,
  3. exercises : [
  4. {
  5. date: {
  6. $gte: 2019-09-22,
  7. $lt: 2019-09-22
  8. }
  9. }
  10. ]
  11. }
  12. UserModel.find(findBy).limit(5).exec((err, data) => {
  13. (err) ? res.json({"error" : "problem searching for exercises: " + err}) : res.json(data);
  14. });
  15.  
  16. {
  17. _id: "bWYqm6-Oo",
  18. user: "rommy",
  19. exersises: [
  20. {
  21. user_id: "bWYqm6-Oo",
  22. date: "2019-09-20T00:00:00.000Z",
  23. description: "stiup",
  24. duration: "22",
  25. _id: "pu90D-dHx"
  26. },
  27. {
  28. user_id: "bWYqm6-Oo",
  29. date: "2019-09-21T00:00:00.000Z",
  30. description: "pushup",
  31. duration: "22",
  32. _id: "YtfsJLOXb"
  33. },
  34. {
  35. user_id: "bWYqm6-Oo",
  36. date: "2019-09-20T00:00:00.000Z",
  37. description: "stiup",
  38. duration: "22",
  39. _id: "pu90D-dHx"
  40. },
  41. {
  42. user_id: "bWYqm6-Oo",
  43. date: "2019-09-24T00:00:00.000Z",
  44. description: "stiup",
  45. duration: "22",
  46. _id: "pu90D-dHx"
  47. }
  48. ],
  49. __v: 9
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement