grails - GORM low level api finds object (Mongodb record) but its still NULL? -
i have code in controller method:
db db = mongoclient.getdb("twcdb"); dbcollection coll = db.getcollection('countrycodes') println coll.findone() println coll.findone().class and output @ console:
[_id:539848b2119918654e7e90c3, country:bermuda, alpha2:bm, aplha3:bmu, numeric:60, fips:bd, iga:model 2] null so how can it finds record class null? because record isn't modeled of domain classes? recognize record's individual fields strings tested record overall classed null? how, why?
you should never phone call class on object there scenarios fail (e.g. getproperty('class') gets called or on "mapish" object, means groovy phone call get('class') -- case basicdbobject (subsubclass of linkedhashmap)). utilize getclass()
mongodb grails gorm
No comments:
Post a Comment