[英]mongodb gmongo runCommand
I'm working on a grails/mongodb project. 我正在研究grails / mongodb项目。 I want to do a full text research on a mongodb database using:
我想使用以下方法对mongodb数据库进行全文研究:
db.test.runCommand( "text", { search : "my_texte" } )
The problem is that I didn't found how to do it in groovy (or using gmongo). 问题是我没有找到如何在groovy(或使用gmongo)中做到这一点。
How do execute a "runCommand" from groovy ? 如何从groovy执行“runCommand”?
Thanks. 谢谢。
I have found the Java version which works: 我找到了适用的Java版本:
DBObject searchCmd = new BasicDBObject();
searchCmd.put("text", "test");
searchCmd.put("search", "mytexte");
CommandResult res = db.command( searchCmd )
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.