Backendless Support
 
Solved

Backendless is reporting a different object count from the objects returned

nextPage is null, totalObjects: 4, but the query only returned 2 objects.

Devices table where clause:

user.objectId is not null AND distance(37.56368426285688, -77.44460105895996, last_known_location.latitude, last_known_location.longitude) <= mi(3.5)

  1. "offset": 0,
  2. "data": [
  3. {
  4. "device_id": "dc81b600270ef982",
  5. "created": 1502607703000,
  6. "receive_notifications": true,
  7. "ownerId": "B033A628-25D0-45B0-FF20-908E57434500",
  8. "last_known_location": null,
  9. "manufacturer": "LGE",
  10. "__meta": "{\"relationRemovalIds\":{},\"selectedProperties\":[\"device_id\",\"created\",\"receive_notifications\",\"ownerId\",\"last_known_location\",\"manufacturer\",\"name\",\"___class\",\"phone_number\",\"model\",\"updated\",\"user\",\"objectId\"],\"relatedObjects\":{}}",
  11. "name": "lucye_vzw",
  12. "___class": "Device",
  13. "phone_number": null,
  14. "model": "LGE",
  15. "updated": null,
  16. "user": null,
  17. "objectId": "D39D799C-4538-31FD-FFAC-47B23B1D0100"
  18. },
  19. {
  20. "device_id": "dc81b600270ef982",
  21. "created": 1502607703000,
  22. "receive_notifications": true,
  23. "ownerId": "B033A628-25D0-45B0-FF20-908E57434500",
  24. "last_known_location": null,
  25. "manufacturer": "LGE",
  26. "__meta": "{\"relationRemovalIds\":{},\"selectedProperties\":[\"device_id\",\"created\",\"receive_notifications\",\"ownerId\",\"last_known_location\",\"manufacturer\",\"name\",\"___class\",\"phone_number\",\"model\",\"updated\",\"user\",\"objectId\"],\"relatedObjects\":{}}",
  27. "name": "lucye_vzw",
  28. "___class": "Device",
  29. "phone_number": null,
  30. "model": "LGE",
  31. "updated": 1503429522000,
  32. "user": null,
  33. "objectId": "9B9CA9E6-4FFC-97DA-FFA1-218A91A77800"
  34. }
  35. ],
  36. "nextPage": null,
  37. "totalObjects": 4
  38. }

Leave a Comment

Comments (12)

photo
1

Hi John,

Please let us know the app id.

Regards,

Mark

photo
1

D5AF1CB4-2698-9DDA-FF93-441EF9736A00

photo
photo
1

is there a user account we can use to make an invocation? You can email the credentials to support@backendless.com.

photo
1

sent via Slack

photo
photo
1

Assigned to a developer to investigate. Internal ticket number: BKNDLSS-15617

photo
1

The problem has been fixed. The problem was only with the calculation of the "totalObjects" value. The data array was correct though.

Regards,

Mark

photo
1

This is not correct. The 4 was correct. There were 4 devices in the area at that time. I validated this by pulling the device IDs and looking up their geolocation. 2 of the devices belonged to one user, the other two belonged to two other users. All four of these devices where in the same building (and I validated this by clicking on the last_known_location in each device and comparing them to each other)

photo
1

Are they distinctly different devices? The problem which we fixed was that "totalCount" query didn't use "distinct", but the query to get the objects did. As a result, there was a discrepancy.

photo
1

Yes, they are distinctly different.

photo
1

Could you please tell me what the devices are? Because the internal query we used in testing showed only 2 distinct device objects.

photo
1

This today, 2 is correct, when the issue occurred, it wasn't. This was a demo we did for an investment team. 2 devices were our marketing folks, 2 devices were our CEO (ipad on one account, and android phone on another).

The easiest way to get the list of devices is to use this:

user.callsign in ('spookyboogie','viper','cobra')

This will give you the device IDs (should get 3 of them), but they are not all in the same locations that they were yesterday.

photo
1

user.callsign in ('spookyboogie','viper','cobra') returns 3 objects with totalObjects also showing 3.

Is there a query which would be returning an incorrect number of objects?

photo