skip to Main Content

MongoDB – Filter array with array

I have one data example like this one in MongoDB. { id: 628a8683fc489c315b330ade, examName : 'Final Exam', schedule: { scheduleDate : '2021-10-18T17:00:00.000+00:00' scheduleName : 'Package Test' package:[ { exclude_question:[1,2], namePackage:testing packageId:628a89c2fc489c315b330b01 } ] }, question:[ { id:1, question:'hello can u…

VIEW QUESTION

Mongodb – Is there a way to project max value in a range then finding documents within a new range starting at this max value in just one aggregate?

Given the following data in a Mongo collection: { _id: "1", dateA: ISODate("2021-12-31T00:00.000Z"), dateB: ISODate("2022-01-11T00:00.000Z") }, { _id: "2", dateA: ISODate("2022-01-02T00:00.000Z"), dateB: ISODate("2022-01-08T00:00.000Z") }, { _id: "3", dateA: ISODate("2022-01-03T00:00.000Z"), dateB: ISODate("2022-01-05T00:00.000Z") }, { _id: "4", dateA: ISODate("2022-01-09T00:00.000Z"), dateB: null },…

VIEW QUESTION

MongoDB – Get data in date sections from an array

I am new to MongoDB, I want to get data in sections from the array. { "name":"User name", "messages":[ { "message":"Message 1", "date":"2022-05-12T00:00:00.000Z" }, { "message":"Message 2", "date":"2022-05-12T00:00:00.000Z" }, { "message":"Message 3", "date":"2022-05-13T00:00:00.000Z" }, { "message":"Message 4", "date":"2022-05-13T00:00:00.000Z" }, {…

VIEW QUESTION
Back To Top
Search