java - 如何根据id查找该对象字段的值 而不是查找对象全部信息?
PHP中文网
PHP中文网 2017-04-18 10:25:29
0
2
368

mysql可以指定select 后面的字段

mongo 通过java 怎么实现该功能 比如我要根据c_oid得到c_title java代码怎么写?

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(2)
左手右手慢动作

It’s just a normal query, please refer to the official documentation.

PHPzhong

It’s very detailed here
http://mongodb.github.io/mong...

For example, fields include below contains the fields you want to return

collection.find(eq("c_oid", "****"))
                .projection(fields(include("c_title"), excludeId()));
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!