Date range filter in Data API

Hi,
I just had a problem with querying with the date range, which seems to be not working. however, the general way of querying is working fine for me.

{
   "filter": {
        "createdAt": {
            "$gte": {
                "$date": {
                    "$numberLong": "1657839600000"
                }
            },
            "$lt": {
                "$date": {
                    "$numberLong": "1657926000000"
                }
            }
        }
    }
}

Hi @Davod_Mozafari - Welcome to the community!

Can you provide further details regarding the issue? I.e. If you’re receiving any errors, unexpected document(s) being returned, full request details after redacting any credentials, API keys and sensitive information.

however, the general way of querying is working fine for me.

Could you also clarify this? My interpretation is that querying perhaps through mongosh, Compass or Data Explorer is working as per normal but you are only encountering issues only when using the Data API. However, please confirm.

Regards,
Jason

3 Likes