条件类似:a=5 or (a=2 and b>3)BasicDBList endList = new BasicDBList(); BasicDBObject forceEnd = new BasicDBObject();forceEnd.put("status", 5); BasicDBList condList = new BasicDBList();BasicDBObject autoEnd = new BasicDBObject();condList.add(new BasicDBObject("status", 2));condList.add(new BasicDBObject("endTime", new BasicDBObject("$lt", new Date())));autoEnd.put("$and",condList); endList.add(forceEnd);endList.add(autoEnd); basicDBObject.put("$or",endList);
时间: 2024-11-06 13:17:56