run command from Java driver for MongoDB
2017-08-03 12:18
405 查看
run command from Java driver
for example:
map to java ==>
command list
https://docs.mongodb.com/manual/reference/command/
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 c driver执行mongo_run_command求sum
- Mongodb driver for java 使用样例
- mongodb停止遇到shutdownServer failed: unauthorized: this command must run from localhost when running db without auth解决方法
- 升级到0.9 log4jmongodb(mongo-java-driver 3.x)后,报No server chosen by WritableServerSelector from cluster description ClusterDescription
- 关于javax.servlet.ServletException: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket. 错
- java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Software caused
- mongo-java-driver -3.2.2学习笔记-02-MongoDB Driver Admin Quick Tour
- how to get the default maximum heap size for Sun's JVM from Java SE 6 or 7
- MongoDB for Java
- java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]ResultSet can not re-read row data for column 4.
- 【MongoDB】1、MongoDB for Java
- mongoDB with java Driver
- MongoDB-JAVA-Driver 3.2版本常用代码全整理(3) - 聚合
- 3 ways to run Java main from Maven
- Caused by: java.net.ConnectException: Call From master/192.168.199.130 to master:9000 failed on connection exception: java.net.ConnectException: Connection refused; For more details see: http://wiki.
- mongodb java driver3.0初探
- Java for LeetCode 026 Remove Duplicates from Sorted Array
- Unable to query for default vendor from RPM: Error while executing process. Cannot run program "rpm"
- 调试经验-java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@localhost:1521:orcl
- java.sql.SQLException:No suitable driver found for http://localhost:3306/school