Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions lib/origin/selectable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,26 @@ def within_spherical_circle(criterion = nil)
end
key :within_spherical_circle, :expanded, "$within", "$centerSphere"

# Adds the $geoIntersects selection to the selectable.
#
# @example Add the selection.
# selectable.geo_intersects(location: {"$geometry" => {:type => "Point", :coordinates => [ 1, 2 ]}})
#
# @example Execute an $geoIntersects in a where query.
# selectable.where(
# :location.geo_intersects => {"$geometry" => {:type => "Point", :coordinates => [ 1, 2 ]}}
# )
#
# @param [ Hash ] criterion The geoIntersects criterion.
#
# @return [ Selectable ] The cloned selectable.
#
# @since 1.2.0
def geo_intersects(criterion = nil)
__override__(criterion, "$geoIntersects")
end
key :geo_intersects, :override, "$geoIntersects"

private

# Create the standard expression query.
Expand Down