Details
-
Improvement
-
Resolution: Unresolved
-
Major - P3
-
None
-
None
-
Query Optimization
-
Minor Change
Description
Consider a collection with documents of the shape
{
|
loc: {type: "Point", coordinates: [1.2, 1.1]}, |
nested: {field: 7}
|
}
|
This aggregation using the $geoNear stage computes new fields in "nested":
db.collection.aggregate({
|
$geoNear: {
|
near: {type: "Point", coordinates: [0, 0]}, |
distanceField: "nested.dist", |
includeLocs: "nested.pt" |
}
|
})
|
However, the aggregation system overwrites the field "nested.field", even though it could be preserved. This behavior occurs if the existing document field shares a prefix with either the "distanceField" or "includeLocs" options.
This ticket is a request to preserve as much existing information as possible.