skip to Main Content

MongoDB : Query documents by values in array

I have those documents : {"_id" : 1, "actors" : [{"matricule" : "AVB", "name":"XXX"}, {"matricule" : "AVB", "name":"YYY"}]} {"_id" : 2, "actors" : [{"matricule" : "PMH", "name":"FFF"}, {"matricule" : "BNG", "name":"HHH"}]} I would like to get only the first document…

VIEW QUESTION

MongoDB lookup in multi label nested array

I am very new in MongoDB. I am trying to make lookup in multi label nested array. My data is looks like bellow. [     {         "_id": "621eedae92979fd8f0e9451d",         "name": "Pallab Koley",         "shifts": {             "_id": "62636b9fcbda6d2b17f5cae0",            …

VIEW QUESTION

Select distinct combination of two fields with a condition in MongoDB (Node JS)

I have this kind of collection named 'Message' [ { _id: new ObjectId("62641aea1fbe19349f8fba78"), text: 'Hello', user: new ObjectId("625b8f00e2464fb758263b4d"), receiver: new ObjectId("62638d3e5bcd98e7e48ca1b7"), createdAt: 2022-04-23T15:27:38.270Z, updatedAt: 2022-04-23T15:27:38.270Z, __v: 0 }, { _id: new ObjectId("6264256fc0ee5093f8d994a0"), text: 'Hi', user: new ObjectId("62638f1495b841266161b032"), receiver: new ObjectId("62638d3e5bcd98e7e48ca1b7"),…

VIEW QUESTION
Back To Top
Search