Using MongoDB Java driver, I would like to find all entries where an array field contains at least 2 entries. What I have tried:
myCollection.find(new Document("arrayFieldname.length", new Document("$gt", 1)));
Unfortunately this returns no entry.
Should the approach be different?
Many thanks, Tom