I've been doing some search but haven't been able to find the answer. From docs, In mongo, if
$match: { type: "airfare"}
translated as:
DBObject match = new BasicDBObject("$match", new BasicDBObject("type", "airfare") );
in Mongo Java driver, how to translate this one into Mongo java driver?
$match : { score : { $gt : 70, $lte : 90 } }
EDIT
This is what I actually wanted to do:
$match : { bookingDateTime: { $gte : fromDate, $lte : toDate } }
And this is how implemented in mongodb java driver, with no luck so far:
DBObject matchFields2 = new BasicDBObject("$match", new BasicDBObject("bookingDateTime", new BasicDBObject("$gte", fromDate.getTime()).append("$lte", toDate.getTime())));
DBObject match2 = new BasicDBObject("$match", matchFields2);
fromDate is a Calendar object so hence the getTime() method to convert Calendar class to Date class.