SETCHAN name [META name value ...] [EX seconds] NEARBY|WITHIN|INTERSECTS key FENCE [DETECT what] [COMMANDS which] param [param ...]
Creates a Pub/Sub channel which points to a geofenced search. If a channel is already associated to that name, it’ll be overwritten. Once the channel is created a client can then listen for events on that channel with SUBSCRIBE or PSUBSCRIBE.
Set a simple channel.
In this example we created a channel named
warehouse that watches for changes to objects in the
fleet collection. When a change occurs the channel
warehouse is notified with a detailed message. The message contains a member named
'detect' which has one of the following values:
insideis when an object is inside the specified area.
outsideis when an object is outside the specified area.
enteris when an object that was not previously in the fence has entered the area.
exitis when an object that was previously in the fence has exited the area.
crossis when an object that was not previously in the fence has entered and exited the area.
For more information on the format of this message please see the topic on Geofencing.