List of usage examples for com.mongodb BasicDBObject containsField
public boolean containsField(final String field)
From source file:uk.co.revsys.oddball.rules.MongoDBHelper.java
private void addCaseBeforeQuery(BasicDBObject query, String before) { long cutoff = 0; try {// ww w .ja va 2 s .c o m cutoff = Long.parseLong(before); } catch (java.lang.NumberFormatException e) { } BasicDBObject subQuery = new BasicDBObject("$lt", cutoff); if (query.containsField("case.time")) { ((BasicDBObject) query.get("case.time")).append("$lt", cutoff); } else { query.append("case.time", subQuery); } }