LearnBoost/mongoose — Issue #586: Support for $within with Array
Author: maxbelanger
Created: 2011-10-29 01:21:07+00:00
State: open

I'm trying to use the geospatial operator "$within" on an array field (e.g. {position: [14, 23]}). The rationale behind the use of an array is the preservation of the order of the elements inside (latitude then longitude), which isn't really guaranteed unless you use an array. However, when I try to use this, I get the following error message (that didn't happen when position was a simple sub-object):

Error: Can't use $within with Array.