Search Object with data range
Hi all,
i want to have an api in my service that return a list of objects created in a time range.
I have create this method in the cloud code js (the model is 'Objects'):
----
/**
*
* @param {DateTime} startDate
* @param {DateTime} endDate
* @returns {Promise.<void>}
*/
getObjectsByRange(startDate, endDate) {
var whereClause = "created at or after "+startDate + " and created at or before "+endDate;
var queryBuilder = Backendless.DataQueryBuilder.create().setWhereClause( whereClause );
var result = Backendless.Data.of( Objects ).find( queryBuilder );
return result;
}
------
but when i tested with "Api Service", return this error "400 - Invalid where clause (1017)"
What am i doing wrong?
Thank
GF
wrap dates into single quotes
Hi jempis
What "startDate" and "endDate" are?
Timestamp or String?
Also you can test your query in the Backendless Console
Leave a Comment
Comments have been locked on this page!