Skip to content
Advertisement

How to get single field in mongodb query?

I have data like this:

JavaScript

i want to show one field like this base on book -> chapter_no -> sub_no

JavaScript

in mongodb query.

Advertisement

Answer

  • $match
  • $unwind
  • $unwind
  • $match
  • $replaceRoot
JavaScript

mongoplayground

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement