Far from an ideal solution, but you can make with an unprocessed request mango and $ where is the operator, for example:
posts = Post.objects.filter(__raw__={'$where': 'this.likes.length > 20'})
Another option, which should work faster, but, in my opinion, is less clear, is to check if the 21st element exists:
posts = Post.objects.filter(likes__21__exists=True)
The second option only works if you are using MongoDB 2.2 +
Source: taken from these answers and applied to MongoEngine.
yprez
source share