Skip to content

Commit 9d9c5e4

Browse files
committed
Try to get sampling of VPD working
1 parent 32beec1 commit 9d9c5e4

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

opensensor/collection_apis.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,13 @@ def get_vpd_pipeline(
241241
}
242242
}
243243
},
244-
{"$group": {"_id": "$group", "doc": {"$first": "$$ROOT"}}},
245-
{"$replaceRoot": {"newRoot": "$doc"}},
244+
{
245+
"$group": {
246+
"_id": "$group",
247+
"timestamp": {"$first": "$timestamp"},
248+
"vpd": {"$avg": "$vpd"},
249+
}
250+
},
246251
{"$project": project_projection},
247252
{"$sort": {"timestamp": 1}},
248253
]

0 commit comments

Comments
 (0)