|
When parsing a MatchExpression, we should raise a user error if we find $_internalBucketGeoWithin anywhere inside an $elemMatch.
For example, this should be a parse error:
db.foo.find({abc: {$elemMatch: {$_internalBucketGeoWithin: {field: "xyz", withinRegion: {$centerSphere: [[0, 0], 10]}}}}})
|
This should be an error because:
- A user would not write this directly: $_internalBucketGeoWithin is an internal expression for time-series.
- We wouldn't generate this internally, because we don't push down $elemMatch on events (if I remember correctly).
- $_internalBucketGeoWithin assumes that its matches() method runs on the entire document, so it wouldn't behave correctly inside $elemMatch anyway.
- One reason it expects to be given the entire document, is that it can read from the bucket's control field. It can use the min/max values to create a bounding region.
|