简体   繁体   中英

how to querying a document with a several criteria on mongoDB & NodeJS

Hi im having a weird problem i have a query this query.

find({username: "user_1" ,  words: { $elemMatch: { "word": "RATIONAL", "subwords": "RAT" } }})

and this is the document structure : [1]: https://i.stack.imgur.com/DGGLo.png

when i try this query on mongoDB shell it works perfectly but when i try it on NodeJS it returns me the document based only the username. thanks everyone

要查找匹配项,请尝试运行此查询:

find({username: "user_1" , "words.word": "RATIONAL", "words.subwords": "RAT" })

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM