Skip to content

GPMONGODB-87: Can not get Dynamic Attributes after a findAll in a collection #215

@graemerocher

Description

@graemerocher

Original Reporter: agile.guo
Environment: Grails 1.3.7,Mongodb 1.0.M6,JDK 1.6
Version: Not Specified
Migrated From: http://jira.grails.org/browse/GPMONGODB-87

{code}
import org.bson.types.ObjectId

class Foo {
ObjectId id
boolean isNew
}
{code}

In a grails console I tried this

{code}
def foos = Foo.createCriteria().list(){
eq('isNew', true)
}

println "................................"
println foos[0]['data'] // ok!
println "................................."

//Must have more than 1 result
//data has been addded Dinaymically
def m2 = foos.findAll{it['data']?.date && !it['data']?.name}

//The filter works ok, but the dynamic attribute just "disappears".....even if i do this
println "................................"
println foos[0]['data'] // null!
println "................................."

m2.each{it, i->
println it['data'] // always null if there are more than 1 record, only the last record has the data attribute
}
{code}

the details please see:
http://grails.1312388.n4.nabble.com/MongoDB-Can-not-get-Dynamic-Attributes-after-a-findAll-in-a-collection-td3327379.html

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions