You can put a spatial view function into a design document by using the object name spatial to indicate the nature of the view definition.
For example, the following design document includes the previous function as a view named points.

To execute the spatial query, use the design document format that uses the embedded spatial function.
For example, a design document named main that resides within the bucket places is executed with this URL: