diff --git a/README.md b/README.md index 9f89149c..15744747 100644 --- a/README.md +++ b/README.md @@ -153,6 +153,20 @@ NEARBY searches a collection for objects that intersect a specified radius.
### Search options +**SPARSE** - This option will distribute the results of a search evenly across the requested area. +This is very helpful for example; when you have many (perhaps millions) of objects and do not want them all clustered together on a map. Sparse will limit the number of objects returned and provide them evenly distributed so that your map looks clean.

+You can choose a value between 1 and 8. The value 1 will result in no more than 4 items. The value 8 will result in no more than 65536. *1=4, 2=16, 3=64, 4=256, 5=1024, 6=4098, 7=16384, 8=65536.*

+ + + + + + + +
No SparsingSearch WithinSparse 1Search WithinSparse 2Search WithinSparse 3Search WithinSparse 4Search WithinSparse 5Search Within
+*Please note that the higher the sparse value, the slower the performance. Also, LIMIT and CURSOR are not available when using SPARSE.* + + **WHERE** - This option allows for filtering out results based on [field](#fields) values. For example
```nearby fleet where speed 70 +inf point 33.462 -112.268 6000``` will return only the objects in the 'fleet' collection that are within the 6 km radius **and** have a field named `speed` that is greater than `70`.

Multiple WHEREs are concatenated as **and** clauses. ```WHERE speed 70 +inf WHERE age -inf 24``` would be interpreted as *speed is over 70 and age is less than 24.*

The default value for a field is always `0`. Thus if you do a WHERE on the field `speed` and an object does not have that field set, the server will pretend that the object does and that the value is Zero. diff --git a/internal/assets/sparse-1.png b/internal/assets/sparse-1.png new file mode 100644 index 00000000..8e4ffafe Binary files /dev/null and b/internal/assets/sparse-1.png differ diff --git a/internal/assets/sparse-2.png b/internal/assets/sparse-2.png new file mode 100644 index 00000000..7834b42b Binary files /dev/null and b/internal/assets/sparse-2.png differ diff --git a/internal/assets/sparse-3.png b/internal/assets/sparse-3.png new file mode 100644 index 00000000..246c2a51 Binary files /dev/null and b/internal/assets/sparse-3.png differ diff --git a/internal/assets/sparse-4.png b/internal/assets/sparse-4.png new file mode 100644 index 00000000..adffd02c Binary files /dev/null and b/internal/assets/sparse-4.png differ diff --git a/internal/assets/sparse-5.png b/internal/assets/sparse-5.png new file mode 100644 index 00000000..bde1716e Binary files /dev/null and b/internal/assets/sparse-5.png differ diff --git a/internal/assets/sparse-6.png b/internal/assets/sparse-6.png new file mode 100644 index 00000000..4418cca7 Binary files /dev/null and b/internal/assets/sparse-6.png differ diff --git a/internal/assets/sparse-none.png b/internal/assets/sparse-none.png new file mode 100644 index 00000000..9256945a Binary files /dev/null and b/internal/assets/sparse-none.png differ