I currently am trying to remove milliseconds from a datetime object in my aggregation of a pymongo query.
I'm grouping by one of their IDs, which they all have in common. I also need the date though.
The current date won't let me group correctly because some objects are 1 millisecond different, so it groups with most of the objects in the grouping, but maybe one of the objects gets left out because of the millisecond time difference.
Edit: I've converted it to a string and it seems to have worked. How do I convert it to a date again within the aggregation. $dateFromString is not working
Is there a way that I can remove the milliseconds so the correct dates all correspond to the same ID?