我的项目配置如下:
我的域名类:
class Story {
String url
String content
String status
String title
}
在Grails Shell中,我使用了以下命令: Story.withCriteria {eq(" url"," url")} Story.findByUrl(" URL&#34)
他们都回来了。
在Mongo shell中:
> db.story.find()
{ "_id" : NumberLong(2), "categories" : [ null, null ], "content" : "content", "status" : "status", "title" : "title", "url" : "url", "version" : NumberLong(1) }
{ "_id" : NumberLong(3), "categories" : [ null, null ], "content" : "content1", "status" : "status1", "title" : "title1", "url" : "url1", "version" : 0 }
{ "_id" : NumberLong(4), "categories_$$manyToManyIds" : [ NumberLong(1), NumberLong(2) ], "category" : NumberLong(1), "content" : "content1", "status" : "status1", "title" : "title1", "url" : "url1", "version" : NumberLong(1) }
{ "_id" : NumberLong(5), "content" : "content1", "status" : "status1", "title" : "title1", "url" : "url1", "version" : 0 }
我的问题是为什么grails动态查找器和标准没有返回任何东西。如果您有任何线索,请帮助我。
谢谢,
答案 0 :(得分:0)