Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

In mongodb. I have One object inside ids of user array , Now I want to lookup for that ids in related users details, with aggregation

  {
        "_id": "61efc2c437c455b7216629ff",
        "event_images": [
            "1643102858880rn_image_picker_lib_temp_38cdc02f-4207-446a-9263-1e6914954095.jpg"
        ],
        "distance": 80,
        "ratio_men": 50,
        "ratio_women": 60,
        "ratio_others": 30,
        "invite_users": [
            "61e6830ae88d1929e3d239f9",
            "61e6830ae88d1929e3d239f9",
            "615ae0e5da07c2f5d777248b",
            "615ae0e5da07c2f5d777248b",
            "61e7beaae88d1929e3627c69",
            "61e7beaae88d1929e3627c69"
        ],
        "notinvited_users": [],

I have Invited user array inside the array i have ids, I want to lookup the user detail with these ids

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

do it yourself
you can do it
you have extreme knowledge of this

or you can try this

const userData = await Event.find({
_id : ObjectId(ID)
,
payment_status : 1
}).populate(‘invite_users’ , {firstname:1})

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading