|
|
Ok, Doing more tests, workarounds, etc.....
def mongo = ctx.getBean('mongo')
def db = mongo.getDB('mongotest')
def fooRaw = db.foo.find(["isNew":true, "data.date" : [$exists:true]])
def m = fooRaw .collect{Foo.get(it._id)}
m.each{
println it['data'] //Always null
}
-------------------------------------
Foo.createCriteria().list{
eq('isNew', true)
}.each{
println it['data'] //but this works!!
}
...................................................
So at the end I think I will filter my collection this way
Foo.createCriteria().list{
eq('isNew', true)
}.each{
if(it['data'].date){
println it['data'] //but this works!!
...............//logic and stuff........
}
}
|