我正在尝试使用以下代码在Grails中创建一个MongoDB集合:
BasicDBObject DBoptions = new BasicDBObject();
DBCollection collection = db.createCollection("xyz",DBoptions)
但是我遇到了以下错误:
Caused by GroovyRuntimeException: Ambiguous method overloading for method com.mongodb.DBApiLayer#createCollection.
Cannot resolve which method to invoke for [class java.lang.String, class com.mongodb.BasicDBObject]
due to overlapping prototypes between:
[class java.lang.String, interface com.mongodb.DBObject]
[class java.lang.String, interface java.util.Map]
有什么解决此问题的想法吗?谢谢。