Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NEARBY does not return distance property in JSON response if distance = 0 #599

Closed
iwpnd opened this issue Mar 4, 2021 · 1 comment
Closed
Milestone

Comments

@iwpnd
Copy link
Contributor

iwpnd commented Mar 4, 2021

Describe the bug
NEARBY does not return distance property in JSON response if distance to the object is 0.

To Reproduce

set fleet bus2 point 33.5123 -112.2693
nearby fleet distance point 33.5123 -112.2693 100

returns

{
  "ok": true,
  "objects": [
    {
      "id": "bus2",
      "object": {
        "type": "Point",
        "coordinates": [
          -112.2693,
          33.5123
        ]
      }
    }
  ],
  "count": 1,
  "cursor": 0,
  "elapsed": "73.9µs"
}

Expected behavior
If I explicitly request the distance to the id I would expect it to return a distance property either way.

Operating System (please complete the following information):

  • OS: Mac OS
  • Version 1.22.6

If this is not intentional I would like to fix this.

@tidwall
Copy link
Owner

tidwall commented Mar 18, 2021

You are probably right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants