java - How to write the Criteria(Query) for MongoDB -
i have written mongo query in robomongo , want write query criteria , query
db.getcollection('collection').find({"_class": "a", devices : {$exists:true}, $where:'this.devices.value.length>0'})
in java writing
final query query = query.query(criteria.where("_class").is(typealias).and("devices").exists(true).and("devices.value.length>0"));
but, not working. can guide me on this?
Comments
Post a Comment