MongoDB PHP查询多维数组实现方法?
最近在学习Mongdb,数据结构如下,从豆瓣API拿到的数据:
在mongod里 find('{"casts.name":"杨幂"}') 是可以查询到结果的。
但是用PHP怎么都实现不了查询 2维以上多维数组里的值,求详解。
(
[_id] => MongoId Object
(
[$id] => 52064a30f8c07620bad63af4
)
[rating] => Array
(
[max] => 10
[average] => 4.8
[stars] => 25
[min] => 0
)
[reviews_count] => 313
[wish_count] => 6308
[collect_count] => 21907
[douban_site] =>
[year] => 2013
[images] => Array
(
[small] => http://img3.douban.com/view/photo/icon/public/p2060736910.jpg
[large] => http://img3.douban.com/view/movie_poster_cover/lpst/public/p2060736910.jpg
[medium] => http://img3.douban.com/view/movie_poster_cover/spst/public/p2060736910.jpg
)
[alt] => http://movie.douban.com/subject/24721493/
[id] => 24721493
[mobile_url] => http://movie.douban.com/subject/24721493/mobile
[title] => 小时代2:青木时代
[do_count] =>
[seasons_count] =>
[schedule_url] => http://movie.douban.com/subject/24721493/cinema/
[episodes_count] =>
[genres] => Array
(
[0] => 剧情
[1] => 喜剧
[2] => 爱情
)
[countries] => Array
(
[0] => 中国大陆
[1] => 台湾
)
[casts] => Array
(
[0] => Array
(
[avatars] => Array
(
[small] => http://img4.douban.com/img/celebrity/small/23698.jpg
[large] => http://img4.douban.com/img/celebrity/large/23698.jpg
[medium] => http://img4.douban.com/img/celebrity/medium/23698.jpg
)
[alt] => http://movie.douban.com/celebrity/1052359/
[id] => 1052359
[name] => 杨幂
)
[1] => Array
(
[avatars] => Array
(
[small] => http://img3.douban.com/img/celebrity/small/39610.jpg
[large] => http://img3.douban.com/img/celebrity/large/39610.jpg
[medium] => http://img3.douban.com/img/celebrity/medium/39610.jpg
)
[alt] => http://movie.douban.com/celebrity/1315611/
[id] => 1315611
[name] => 柯震东
)
[2] => Array
(
[avatars] => Array
(
[small] => http://img3.douban.com/img/celebrity/small/44400.jpg
[large] => http://img3.douban.com/img/celebrity/large/44400.jpg
[medium] => http://img3.douban.com/img/celebrity/medium/44400.jpg
)
[alt] => http://movie.douban.com/celebrity/1274814/
[id] => 1274814
[name] => 郭采洁
)
[3] => Array
(
[avatars] => Array
(
[small] => http://img3.douban.com/img/celebrity/small/1372773609.01.jpg
[large] => http://img3.douban.com/img/celebrity/large/1372773609.01.jpg
[medium] => http://img3.douban.com/img/celebrity/medium/1372773609.01.jpg
)
[alt] => http://movie.douban.com/celebrity/1274684/
[id] => 1274684
[name] => 凤小岳
)
)
[current_season] =>
[original_title] => 小时代2:青木时代
[summary] => 日子一天一天的过去,林萧(杨幂 饰)、顾里(郭采洁 饰)、南湘(郭碧婷 饰)、唐宛如(谢依霖 饰)四人也迎来了大学毕业这一天,正当所有人都在为毕业之后做着规划的时候,顾里却开始着手自己的生日宴会。这本是一年一度朋友圈里最大的大事,却没想到成为顾里最不愿回想起的记忆,与此同时顾里的家庭发生了重大的变故,她也遭受到了成长以来最大的打击。而林萧、唐宛如、南湘的生活也随着大学生活的结束变得不再平稳。生活相继发生着种种让她们措手不及、不知如何面对、需要抉择的事情。姐妹四人在面对家庭、事业、爱情和友情的巨大转变下,能否依然坚持自己的生活态度?能否坚守住自己的幸福?
[subtype] => movie
[directors] => Array
(
[0] => Array
(
[avatars] => Array
(
[small] => http://img4.douban.com/img/celebrity/small/1372241745.58.jpg
[large] => http://img4.douban.com/img/celebrity/large/1372241745.58.jpg
[medium] => http://img4.douban.com/img/celebrity/medium/1372241745.58.jpg
)
[alt] => http://movie.douban.com/celebrity/1313751/
[id] => 1313751
[name] => 郭敬明
)
)
[comments_count] => 11932
[ratings_count] => 20070
[aka] => Array
(
[0] => 小时代2
[1] => Tiny Times 2.0
)
)
相关阅读:
jsonrpc4j在客户端调用不通,能讲得更详细些么?
如何用原生js触发浏览器绑定事件?
mongodb PHP客户端怎么获取单个document的大小?
mac环境下安装mamp,PHP文件不能解析。
return多个值的引用方法
gem install rails在#中ok,但是在 $中成功安装,但是无法执行?
获取跳转前的url
CSS3 border凹陷该如何编写?
Jquery监听input事件
经常看到'foo'=>'bar'这种举例,前面那个词什么意思呢?
ios开发怎么将image转为data二进制
如何快速入手一些js的框架?
请问各位大哥,如果我获取到一个节点的id后我想把一段html代码插入到获取元素的前边或者后边怎么办
Web服务器运行在www-data:www-data的用户组及用户下,php程序应该设置到哪个用户组及用户,才能保证安全性?
javascript 正则前瞻匹配如何理解?
git clone时遇到“fatal: index-pack failed”
c++中函数重载的原则是什么啊?
discuz学习
远程引用文件的时候 不写http或者https会有问题吗
es6中关于let的一个疑问?