I have a collection with documents containing a date.
Is there a way to find all documents from a particular month (all years), using db.myCollection.find()
?
I managed to achieve approximately what I need by using the aggregation pipeline and the $month
operator, but I couldn't find anything similar among the 'query and projection' operators.
I do not need to group the documents (I only need to filter them).
I am modifying some code that creates filters dynamically based on the user selection and the code uses find
with the generated filters.
I would like to be able to give a user the ability to see only entries from particular months (say, only entries for the summer season).
Finally is there a performance difference between using a filter with find
and using the equivalent filter in a $match stage with the aggregation pipeline ?