Hi, thanks for reaching out! It seems like you might be trying to target specific content by using $gte. Would you mind providing a little more context around what you’re trying to achieve? Thanks!
Sure!
For simplicity: I have a model eg. myEntry, which has a field date of type Date.
Then I’m creating few myEntry entities with different dates. (API returns values formatted like this: Wed Jul 15 2020 00:00:00 GMT+0200 (Central European Summer Time).)
Then I’m trying to filter entries by my date field: before and after specific date.
For entries with date set BEFORE specific date (or equal to) I was trying: query.data.date.$lte: [some date toString() or toISOString()],
and for the opposite query.data.date.$gte: [some date toString() or toISOString()].
Thanks for the details! We’re working on getting an update released soon so that it will be saved as a timestamp (number). That way you can do something like this:
query.data.dateInput.$gte: new Date(...).getTime()
Hi @aubergine! I wanted to let you know that this functionality has been released and you can use the timestamp field type for your query. Please don’t hesitate to reach out if you have additional questions!
I’m having the same issue but for the field publishedAt which seems to be saved as a date and not as a timestamp.
Any way to query content depending on the published date ?