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

Add SCAN to Roaming Geofences #96

Closed
tidwall opened this issue Dec 9, 2016 · 1 comment
Closed

Add SCAN to Roaming Geofences #96

tidwall opened this issue Dec 9, 2016 · 1 comment

Comments

@tidwall
Copy link
Owner

tidwall commented Dec 9, 2016

This is in reference to the issue #93 filed by @amorskoy.

For example, the following command:

NEARBY people FENCE ROAM people * 5000

Which would result in notification that looks like:

{"command":"set","detect":"roam","hook":"",
"time":"2016-12-08T09:27:54.306035387-07:00",
"key":"people","id":"bob",
"object":{"type":"Point","coordinates":[-115.01,33.01]},
"nearby":{"key":"people","id":"alice","meters":1451.138152186708}}

But if you want additional details about alice, you should be able to enter:

 NEARBY people FENCE ROAM people * 5000 SCAN :*

Which would do a SCAN alice:* prior to sending each notification and the result would look like:

{"command":"set","detect":"roam","hook":"",
"time":"2016-12-08T09:27:54.306035387-07:00",
"key":"people","id":"bob",
"object":{"type":"Point","coordinates":[-115.01,33.01]},
"nearby":{
  "key":"people","id":"alice","meters":1451.13,
  "objects":[
      {"id":"alice","object":{"type":"Point","coordinates":[-115.02,33.02]}},
      {"id":"alice:lastname","object":"Denton"}
   ]
}}

Where the objects field includes all objects that match on 'SCAN alice:*` plus the target object.

@amorskoy
Copy link

Super! Thanks lot @tidwall

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

No branches or pull requests

2 participants