skip to Main Content

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

Mongodb – aggregate match subarray

I trying to match the data in Subarray for some reason it is grouped like this. Data : { "_id": 1, "addresDetails": [ [ { "Name":"John", "Place":"Berlin", "Pincode":"10001" }, { "Name":"Sarah", "Place":"Newyork", "Pincode":"10002" } ], [ { "Name":"Mark", "Place":"Tokyo", "Pincode":"10003"…

VIEW QUESTION

Mongodb – Query document count by multiple ranges returning range start/end with matching element count

I've been trying to create a query on documents like these: [ { "timestamp": new ISODate('2020-01-01T00:00:00'), "objectId": "Id_A", "locationId": "Location_A" }, { "timestamp": new ISODate('2021-01-01T00:00:00'), "objectId": "Id_A", "locationId": "Location_A" }, { "timestamp": new ISODate('2022-01-01T00:00:00'), "objectId": "Id_A", "locationId": "Location_B" }, {…

VIEW QUESTION
Back To Top
Search