我所知道的:mongod 正在运行,数据库存在,集合存在,我可以使用 mongodb 控制台进行插入,并且通过 Grails 建立到 mongod 实例的连接(即我可以查询等等)。
其他细节:Grails 2.01、mongodb 插件 1.0.0 RC4、hibernate 插件 2.01、mongodb 2.0.3
class Node {
static mapWith = "mongo"
static constraints = {
}
ObjectId id
Integer someId //someId can be null or just non-existent
String name
}
什么不起作用:我无法通过 GORM 插入任何数据,即使我明确地将 flush 设置为 true。
def n = com.company.project.Node(name: "test")
n.save(flush:true)
我也在 Grails 控制台中尝试过,但没有错误消息。有什么我做错了吗?