From 7c2b45ca1edb8dd3acce703c65947d694b088430 Mon Sep 17 00:00:00 2001 From: Ray <19767256+GithubArray@users.noreply.github.com> Date: Sun, 7 Sep 2025 15:37:54 -0400 Subject: [PATCH] update completer for several functions: - $lookup: update to new syntax that support sub-pipeline - $sortArray: new in v5.2+ - $toUUID: new in v8.0 --- internal/web/src/completer.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/internal/web/src/completer.js b/internal/web/src/completer.js index 341521d..1381d3e 100644 --- a/internal/web/src/completer.js +++ b/internal/web/src/completer.js @@ -647,7 +647,7 @@ var Completer = function (config) { }, { caption: "$lookup", - value: '$lookup: {\n "from": "collection to join",\n "localField": "field from the input documents",\n "foreignField": "field from the documents of the from collection",\n "as": "output array field"\n}', + value: '$lookup: {\n "from": "collection to join",\n "localField": "field from the input documents",\n "foreignField": "field from the documents of the from collection",\n "let": {var1: "val1"},\n "pipeline": [],\n "as": "output array field"\n}', meta: "aggregation stage" }, { @@ -1187,6 +1187,11 @@ var Completer = function (config) { value: '$topN: {\n "n": "expression",\n "sortBy": { "field": 1 },\n "output": "expression"\n}', meta: "aggregation accumulator (v5.2+)" }, + { + caption: "$sortArray", + value: '$sortArray: { input: "$arr", sortBy: { field: 1 } }', + meta: "aggregation accumulator (v5.2+)" + }, { caption: "$linearFill", value: '$linearFill: "expression"', @@ -1207,6 +1212,11 @@ var Completer = function (config) { value: '$tsSecond: "expression"', meta: "aggregation (v5.1+)" }, + { + caption: "$toUUID", + value: '$toUUID: "expression"', + meta: "aggregation (v8.0+)" + }, ].map(addInsertMatch).concat(basicBsonSnippet)