Mongo db - Querying nested array and objects

前端 未结 2 548
醉话见心
醉话见心 2020-12-29 04:29

I have the following document structure:

{
   \"_id\":\"12345\",
   \"value\":{
      \"T\":0,
      \"v\":[
         {
            \"name\":\"JW\",
                 


        
2条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-29 04:54

    It's not clear exactly what you tried, but this should work to find the above doc by name:

    db.collection.find({ "value.v.name": "JW" })
    

    Reference

提交回复
热议问题