I have a Mongo collection that contains a dateTime field called "DateOfCreation". Given that I have a specific number of month, how can I get all documents that matches to month of the DateOfCreation field?
Below, is what I tried to do, but it does not work and returns 0 Documents.
var documents = Collection.Aggregate()
.Match(new BsonDocument("DateOfCreation", new BsonDocument("$month", new BsonDocument("$eq", 3))))
.Group(groupFields)
.ToList();
3 - is my number of month (march)
Similarly, I would like to do it for year, day and so on