I am trying to filter the schedule entries on a CMS Data Model but without success.
I am making the request through REST API.
This is some examples of request that i tried:
https://cdn.builder.io/api/v2/content/wissenswelt-poll?apiKey=6bdfd3f286da46e1a72110ce56bd844c&query.startDate.$lte=1679593597
This request return empty results even though i have items with startDate earlier than that timestamp.
https://cdn.builder.io/api/v2/content/wissenswelt-poll?apiKey=6bdfd3f286da46e1a72110ce56bd844c&query.startDate.$or={item={$eq: null}},{item={$lte: 1679593597}}
This request return 500 unknown operator: $or
Does anyone have any idea how to solve this?
Thanks!
Hi @ruimartins,
Welcome to the builder.io forum.
https://cdn.builder.io/api/v2/content/wissenswelt-poll?apiKey=6bdfd3f286da46e1a72110ce56bd844c
Can you try to query using firstPublished or createdDate and see how that works for you?
Thanks for your quick answer @manish-sharma!
Sorry, wrong endpoint.
https://cdn.builder.io/api/v2/content/wissenswelt-articles?apiKey=6bdfd3f286da46e1a72110ce56bd844c
You can check all items with this endpoint and try to query them by startDate:
https://cdn.builder.io/api/v2/content/wissenswelt-articles?apiKey=6bdfd3f286da46e1a72110ce56bd844c&includeUnpublished=true
Some items have startDate, the ones that are scheduled, plus, the firstPublished or createdDate keys dont tell me the scheduledDate (the date to go live).
Hi @ruimartins,
We are able to query using startDate: https://cdn.builder.io/api/v2/content/wissenswelt-poll?apiKey=6bdfd3f286da46e1a72110ce56bd844c&query.startDate.$eq=null
Looks like you have not set startDate or endDate for both the content associated with wissenswelt-poll
model. Kindly try to set the startDate
and then publish the content to query using startDate.
This also seems to work
https://cdn.builder.io/api/v2/content/wissenswelt-poll?apiKey=6bdfd3f286da46e1a72110ce56bd844c&query.createdDate.$lte=1666686608053