I am trying to extract multiple document types from Mongo database in a single query. If I use find method it requires me to specify class type, and therefore restricting me to get only one document type. For example if I have a collection that contains MongoDocumentA and MongoDocumentB, myList will get MongoDocumentA objects and any other documents will be nulls. Is there anyway around this?
Query query = new Query(Criteria.where("cir_group_status").ne(3).andOperator(Criteria.where("time").gte(startTime),Criteria.where("time").lt (stopTime)));
List myList = mongoOperation.find(query, MongoDocumentA.class);
Much appreciated!