您的位置:首页 > 数据库 > Mongodb

run command from Java driver for MongoDB

2017-08-03 12:18 405 查看
run command from Java driver

for example:

eval command:
{
eval: <function>,
args: [ <arg1>, <arg2> ... ],
nolock: <boolean>
}


map to java ==>

Document command = new Document();
command.put("eval", "function () { var result = db.test.findOne( { test_name : \"test_name0\" }); return Object.bsonsize(result); }");
command.put("args", "");
database.runCommand(command);


command list

https://docs.mongodb.com/manual/reference/command/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  mongodb java
相关文章推荐