Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var findBy = {
- _id : bWYqm6-Oo,
- exercises : [
- {
- date: {
- $gte: 2019-09-22,
- $lt: 2019-09-22
- }
- }
- ]
- }
- UserModel.find(findBy).limit(5).exec((err, data) => {
- (err) ? res.json({"error" : "problem searching for exercises: " + err}) : res.json(data);
- });
- {
- _id: "bWYqm6-Oo",
- user: "rommy",
- exersises: [
- {
- user_id: "bWYqm6-Oo",
- date: "2019-09-20T00:00:00.000Z",
- description: "stiup",
- duration: "22",
- _id: "pu90D-dHx"
- },
- {
- user_id: "bWYqm6-Oo",
- date: "2019-09-21T00:00:00.000Z",
- description: "pushup",
- duration: "22",
- _id: "YtfsJLOXb"
- },
- {
- user_id: "bWYqm6-Oo",
- date: "2019-09-20T00:00:00.000Z",
- description: "stiup",
- duration: "22",
- _id: "pu90D-dHx"
- },
- {
- user_id: "bWYqm6-Oo",
- date: "2019-09-24T00:00:00.000Z",
- description: "stiup",
- duration: "22",
- _id: "pu90D-dHx"
- }
- ],
- __v: 9
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement