This question is locked. New answers and comments are not allowed.
Trying to filter table data using the ModifiedAt but keep getting the "Invalid filter expression" error.
I'm posting this in the header:
The error returned is:
Can anyone advise on the correct format/query string?
I'm assuming I've got the format wrong as a simple Name filter works Ok:
I'm posting this in the header:
X-Everlive-Filter: {"ModifiedAt" : {"$gte" : 2015-03-30T00:00:00.000} }
{"message":"Invalid filter expression.","errorCode":608}
Can anyone advise on the correct format/query string?
I'm assuming I've got the format wrong as a simple Name filter works Ok:
X-Everlive-Filter: {"Name" : "Bananas3"}
8 Answers, 1 is accepted
0
Hi Chris,
You have to put the date in quotes.
Here is the correct filter:
{"ModifiedAt" : {"$gte" : "2015-03-30T00:00:00Z" } }
If you need more help, do not hesitate to contact us.
Regards,
Dimitar Dimitrov
Telerik
You have to put the date in quotes.
Here is the correct filter:
{"ModifiedAt" : {"$gte" : "2015-03-30T00:00:00Z" } }
If you need more help, do not hesitate to contact us.
Regards,
Dimitar Dimitrov
Telerik
Everlive is now Telerik Backend Services, and is part of the Telerik Platform.
0
Chris
Top achievements
Rank 1
answered on 31 Mar 2015, 02:27 PM
ah, of course......It worked.
Thanks
Thanks
0
I'm glad it worked.
If there are more problems, feel free to post here.
Regards,
Dimitar Dimitrov
Telerik
If there are more problems, feel free to post here.
Regards,
Dimitar Dimitrov
Telerik
Everlive is now Telerik Backend Services, and is part of the Telerik Platform.
0
Michael
Top achievements
Rank 1
answered on 08 Oct 2015, 02:28 PM
In a cloud fonction, i am using the javascript SDK.
In this case, what is the format for filtering by date?
yyyy-mm-ddT00:00:00.000Z ?
yyyy-mm-ddT00:00:00Z ?
thank you
------- code -------
var data = Everlive.Sdk.$.data('objectType');
var filter={ "date_field" : { "$lt" : "yyyy-mm-ddT00:00:00.000Z" }};
data.destroy(filter,success,error});
0
Michael
Top achievements
Rank 1
answered on 08 Oct 2015, 02:32 PM
or mm/dd/yyyy 12:00 AM?
0
Michael
Top achievements
Rank 1
answered on 08 Oct 2015, 02:58 PM
or can i use just mm/dd/yyyy?
0
@Michael
Consider the following example using the Date JavaScript object which is the proper way to filter on Date values:
Let me know if this works for you.
Regards,
Anton Dobrev
Telerik
Consider the following example using the Date JavaScript object which is the proper way to filter on Date values:
Copy Code
var
today =
new
Date();
var
query =
new
Everlive.Sdk.Query();
var
todayMinusOneDay = today.setDate(today.getDate() - 1);
query.where().lt(
'CreatedAt'
,
new
Date(todayMinusOneDay ));
// all items created before one day
data.destroy(query,
function
(data) {
response.body = data;
done();
},
function
(err) {
response.body = err;
done();
});
Let me know if this works for you.
Regards,
Anton Dobrev
Telerik
Everlive is now Telerik Backend Services, and is part of the Telerik Platform.
0
Michael
Top achievements
Rank 1
answered on 13 Oct 2015, 09:52 AM
perfect, thanks a lot