Check the docs you likely to use $or as a pipeline operator but there is no such operator: DOC
INstead you can construct an $match operator which is inside can contain an or clause
Something like this in shell:
db.collection.aggregate({$match:{$or:[{someKey:'someValue'},{someOtherKey:'someOtherValue'}]}})
What you have to change is something like this in JAVA:
Change this:
DBObject matchCriteria = new BasicDBObject("$or", or);
To this:
DBObject orCriteria = new BasicDBObject("$or", or);
DBObject matchCriteria = new BasicDBObject("$match", orCriteria);