Reputation: 105043
I want to find a document with x
larger than the size of the array y
. I'm doing this:
db.find(x: { $gt: { $size: "$y" } })
Doesn't find anything. What is wrong?
The last document should be returned:
{x: 0, y: [0, 1]}
{x: 1, y: [0, 1]}
{x: 2, y: [0, 1]}
{x: 3, y: [0, 1]} # 3 is larger than 2
Upvotes: 1
Views: 40