skip to Main Content

Mongodb – How to filter data in collection containing documents with 3 level nested arrays depending on the values in the first and last nested array mongo

I appreciate any help in such case. Collection in MongoDB (now only 4 documents for demonstration purpose): { "_id" : ObjectId("62684847e9594c65cbaa5d85"), "agentId" : NumberInt(1), "agentName" : "Yardi Gaondi", "policyList" : [ { "receivedDate" : ISODate("2022-03-23T04:46:15.000+0000"), "policyStatusDetail" : [ { "policyStsCode"…

VIEW QUESTION

Is there any substitute of $arrayToObject in MongoDb

I have a requirment of inverting an object keys & values. I have following type of data: [ "elements": { "title": "elem_1_6_title", "sub_title": "elem_1_6_sub_title", "media": "elem_1_6_media", "button": "elem_1_6_button", "give_us_call": "elem_1_6_give_us_call" }, "elements": { "title": "elem_1_6_title", "sub_title": "elem_1_6_sub_title" }, "elements": {}…

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