search

Home  >  Q&A  >  body text

mongodb能不能搜索多层嵌套子文档中的任意内容?

比如,能不能搜素N层嵌套中的键或者值

阿神阿神2793 days ago580

reply all(2)I'll reply

  • 大家讲道理

    大家讲道理2017-04-27 09:04:16

    You can do it. As long as you can locate the position of the array containing the sub-document, you can search for what you want. You can check my previous answer:

    /q/1010000002943721/a-1020000003716002

    If it does not meet your requirements, you can describe your problem in more detail, such as what the data structure you imagine looks like and what kind of search you want to do

    reply
    0
  • 阿神

    阿神2017-04-27 09:04:16

    No problem, you can refer to the official documentation directly

    https://docs.mongodb.org/manual/tutorial/query-documents/#embedded-documents

    reply
    0
  • Cancelreply