Query all documents matching array of sub-documents #10945
Unanswered
vineetdigit
asked this question in
Q&A
Replies: 1 comment
-
Maybe you're looking for |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
My apologies since this question is not specific to mongoose, but MongoDB. But I have always found high-quality answers in this forum than elsewhere, hence asking it here.
I have a schema as follows
I need to find all documents that match the fields of elements in the children array.
I know there is an $in operator but it works on only single field (e.g. postId). E.g. If children array was defined as [Number] where each element is a postId, then I could use
Beta Was this translation helpful? Give feedback.
All reactions