Backendless Support
 
Waiting for user's response

Issue With Dates in Search

I am using the following Data Query to retrieve objects for every 5 sec. if there is no objects after the given created date and time but i am able to get the object which is created at the date and time what i am passing. Now i am using Backendless 4.0, in 3.0 the same thing works fine.

Example :

  1. let dataQuery = DataQueryBuilder()
  2. dataQuery!.setSortBy(["created DESC"])
  3. dataQuery!.setPageSize(40)
  4. let whereClause = "groupId = '\(channelID)' AND created after '05/14/2017 22:21:54 GMT+5:30'" (after this date and time there are no objects but i am getting the object which is created at '05/14/2017 22:21:54 GMT+5:30')
  5. dataQuery!.setWhereClause(whereClause)

Please Assist.

Thanks

Suresh

Leave a Comment

Comments (2)

photo
1

Hello SURESH,

could you got to rest console http://take.ms/SfnTI and make a query to reproduce your issue, than export it as cUrl http://take.ms/Toebhs and send to us with description of expected result

photo
1

Hi Sergey,

As requested i am sending the cURL

curl -X GET 'https://api.backendless.com/BA67ABF2-938D-1021-FF7F-798015C6D000/A51F3F3F-7C34-2CC4-FF1C-1DB787239300/data/GroupMessages?where=groupId%20%3D%20'BB4A5B36-4A9E-BBD4-FF6A-D3F664DB7100'%20AND%20created%20after%20'05%2F15%2F2017%2006%3A46%3A10%20GMT%2B5%3A30''

and the expected result should be messages after the given date and time, but it is giving the messages at that time and after. it should be > not >=

I changed the where clause to

  1. let whereClause = "groupId = '\(channelID)' AND created after \(lastMessageCreatedAt!.timeIntervalSince1970 * 1000)"

then it is working fine. is this is the correct way to do ?

Thanks

Suresh