Hi. After some research I find that:
a) In your example "birth_date" is a [login to view URL] object, but this should be a [login to view URL] object, since MongoDB (BSON) don't have a type for date without time. Trying to store a date object in MongoDB results in an error saying date object cannot be encoded.
b) Queries like [login to view URL](customs__birth_date__gte=[login to view URL](2010, 1, 1)) works (honestly I have no idea why this would work but sure it is as I tested). So:
[login to view URL](
customs__birth_date__gte=[login to view URL](2010, 1, 1),
customs__birth_date__lt=[login to view URL](2011, 1, 1),
)
gives you all people with birth date greater than or equal to 20100101 and less than 20110101, which is exactly all people with birth year 2010. The same technique can be used to find out all people whose age is under 18: just filter birth date greater than [current date - 18 years].
So your requests (2) and (3) are fulfilled.
c) Your request (1) is harder than it seems. This cannot be done by normal queries, but can be done using aggregations, since aggregation mechanism provides "$month" operator to extract month from a date. I haven't figure out how to do it yet, but it is possible.
Please contact me if you want me to do more research and finish this for you. Thanks.