Details
-
New Feature
-
Resolution: Fixed
-
Major - P3
-
None
-
None
-
None
-
Fully Compatible
Description
A query like this:
db.coll.aggregate([
|
{$group: {
|
_id: "$meta.a",
|
mostRecent: {$topN: {
|
n: 1,
|
sortBy: {ts: -1},
|
output: {
|
ts: "$ts",
|
measureA: "$measureA",
|
measureB: "$measureB"
|
}
|
}}
|
}}
|
])
|
or
db.coll.aggregate([
|
{$group: {
|
_id: "$meta.a",
|
mostRecent: {$top: {
|
sortBy: {ts: -1},
|
output: {
|
ts: "$ts",
|
measureA: "$measureA",
|
measureB: "$measureB"
|
}
|
}}
|
}}
|
])
|
Will be rewritten to something like this to get the last point optimization:
db.measurements.aggregate([
|
{$sort: {"meta.a": 1, "ts": -1}},
|
{$group: {
|
_id: "$sensorId”,
|
ts: {$first: "$ts”},
|
measureA: {$first: "$measureA"},
|
measureB: {$first: "$measureB"}
|
}}
|
])
|
Attachments
Issue Links
- is depended on by
-
SERVER-61659 TS Last Point opt: final test plan review
-
- Closed
-