search

Home  >  Q&A  >  body text

mongodb - Can mongoose query the value of the corresponding key of the document object?



The document information is shown in Figure 2. When I query through Figure 1, I get undefined. Why?

巴扎黑巴扎黑2742 days ago810

reply all(2)I'll reply

  • PHPz

    PHPz2017-05-17 10:06:00

    Dear, here is a question similar to yours that has been answered. Let’s see if your situation is the same as his: /q/10...

    reply
    0
  • 某草草

    某草草2017-05-17 10:06:00

    There must be definition-related keys in the schema. For example, if there is type in schameA, but you add an additional category to docA during your operation, then querying docA.category will output undefined, because schemaA does not have it

    reply
    0
  • Cancelreply