Mongodb query specific month|year not date
With MongoDB 3.6 and newer, you can use the $expr operator in your find() query. This allows you to build query expressions that compare fields from the same document in a $match stage. db.customer.find({ “$expr”: { “$eq”: [{ “$month”: “$bday” }, 9] } }) For other MongoDB versions, consider running an aggregation pipeline that uses … Read more