Spring通过JavaScript操作MongoDB

来源:互联网 发布:天龙八部发型颜色数据 编辑:程序博客网 时间:2024/05/23 14:04
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="white-space:pre"></span>MongoOperations mongoOps = new MongoTemplate(new SimpleMongoDbFactory(new Mongo(), "test"));</span>
<span style="white-space:pre"></span>CommandResult commandResult = mongoOps.getCollection("collection").getDB().doEval(SCRIPTS);        if(commandResult.ok()){            //code...        }else{            //code...    }


0 0