skip to Main Content

How to lookup a sub-array in mongodb?

I tried to use aggregate and lookup but look like I cannot keep role in the members item. Any idea how to resolve it? db.groups.insertMany([ { title: 'Hi', members: [ { userId: ObjectId('62589515f239750e7e44b958'), role: 'Admin' }, { userId: ObjectId('655f634c632d0c23b9d455de'), role:…

VIEW QUESTION
Back To Top
Search