【发布时间】:2018-04-10 19:27:16
【问题描述】:
{
"docs":{
"count":2,
"users":[
{
"_id":"5acc820965c9633fbd851ff7",
"title":"Yamaha Fazer",
"description":"this is the dummy description for the yamaha bike. ",
"image_url":"http://666a658c624a3c03a6b2-25cda059d975d2f318c03e90bcf17c40.r92.cf1.rackcdn.com/unsplash_52c470899a2e1_1.JPG"
},
{
"_id":"5acc8283aa63b6401ac290f0",
"title":"Apache RR 310",
"description":"this is the dummy description for the Apache RR 310 bike. ",
"image_url":"http://666a658c624a3c03a6b2-25cda059d975d2f318c03e90bcf17c40.r92.cf1.rackcdn.com/unsplash_52c470899a2e1_1.JPG"
}
]
}
}
【问题讨论】:
-
你需要得到什么价值?你的预期输出是什么?
-
计数和用户的价值..我在做类似的事情时遇到错误。 docs.count
-
var data = <your JSON object here>; var count = data.docs.count;