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
In the parse_datestring method in stac_fastapi/mongo/utilities.py, which is used for generating the MongoDB query dict, the input time is converted from a string to a python datetime object back to a string. This can only work when the datetime is stored as a string in the MongoDB. However, the recommended way is to store dates/times as datetime objects in the MongoDB. Using my MongoDB where the item's datetime property is stored as a datetime object, queries with datetime filtering always returns no result.
When replacing return dt.strftime("%Y-%m-%dT%H:%M:%SZ") by return dt, then the datetime filtering works for me.
The text was updated successfully, but these errors were encountered:
In the
parse_datestring
method instac_fastapi/mongo/utilities.py
, which is used for generating the MongoDB query dict, the input time is converted from a string to a python datetime object back to a string. This can only work when the datetime is stored as a string in the MongoDB. However, the recommended way is to store dates/times as datetime objects in the MongoDB. Using my MongoDB where the item's datetime property is stored as a datetime object, queries with datetime filtering always returns no result.When replacing
return dt.strftime("%Y-%m-%dT%H:%M:%SZ")
byreturn dt
, then the datetime filtering works for me.The text was updated successfully, but these errors were encountered: