Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • I'm not sure that works because the starting dataset is an array... could you please confirm that your code can bypass 2 arrays? I'm not sure if I'm testing the code wrong or if the code can't access double arrays. Maybe it needs $elemMatch somewhere but I tried so many times and couldn't get it to work Commented Feb 29, 2020 at 5:33
  • So is it like this: mongoplayground.net/p/8yPdPJ1C2cB ? or can you show exactly how single object looks like? Commented Feb 29, 2020 at 5:34
  • Ah yes, just like in that playground. Question 1 would be how to return this object {"issue_title":"TitleA3","_id":"A3"} by itself. I tried the code you suggested but it's giving me error and maybe we need to integrate "aggregate" somehow? Commented Feb 29, 2020 at 5:39
  • @wongz modified my answer Commented Feb 29, 2020 at 5:44
  • thanks, the first code works. The second one may need aggregate as well? Commented Feb 29, 2020 at 5:48