我有一个问题,grails在我的mongdb中的单个属性集上返回null值。从mongo控制台查看集合,该值显然设置为“INFO”
....
"name" : "test"
"rules" : [
{
"field" : "level",
"dataType" : "String",
"value" : "INFO",
"comparator" : "="
}
]
....
以下内容将在除值字段以外的所有属性上显示ok值:
def list = TheDomainObject.findByName("test")
list.rules.get(0).comparator -> results in return "="
list.rules.get(0).field -> results in return "level"
list.rules.get(0).value -> results in return null
我缺少什么,为什么值字段返回null? 域定义为:
String field
String comparator
Object value
String dataType
static constraints = {
field nullable: false, blank: false
comparator nullable: false, blank: false
value nullable: false
dataType nullable: false, blank: false
}
运行grails 2.1.1和mongodb 2008plus-2.0.5