Suppose I have:
Order: {_id: ..., items: [...]}
How to filter orders which have item number greater than 5?
I too faced this dilemma. Not sure why it doesnt exist in MongoDB by default. The most efficient way is to also store a property called count or length or something that denotes how many items are in the array.
Then you can index that property and do range queries on it. It'll keep your queries simple and quick.
Just make sure that your application keeps it in sync.