Situation: I have collection with documents, each document contains such fields: \"_id\"(ObjectId), \"userId\"(String), but it also can be field \"files\"(Object).
When
You can construct this Query to get all documents that contains files filed:
Query
files
Query.query(Criteria.where("files").exists(true))