You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there, I'm having troube when trying to save a Document with a basic date field: last_update: datetime.date = mongoz.Date() like described https://mongoz.tarsild.io/fields/#date
When I change the type to last_update: datetime.datetime = mongoz.DateTime() everything works fine.
Is this an issue with mongoz or with how MongoDB/BSON handles dates, can we only use DateTime?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi there, I'm having troube when trying to save a Document with a basic date field:
last_update: datetime.date = mongoz.Date()
like described https://mongoz.tarsild.io/fields/#dateerror message:
bson.errors.InvalidDocument: cannot encode object: datetime.date(2024, 7, 10), of type: <class 'datetime.date'>
When I change the type to
last_update: datetime.datetime = mongoz.DateTime()
everything works fine.Is this an issue with mongoz or with how MongoDB/BSON handles dates, can we only use DateTime?
Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions