Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(aggregation): support for 5.1 operators VSCODE-302 #357

Merged
merged 2 commits into from
Oct 25, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@
"mocha": "^8.2.1",
"mocha-junit-reporter": "^2.0.0",
"mocha-multi": "^1.1.3",
"mongodb-ace-autocompleter": "^0.6.0",
"mongodb-ace-autocompleter": "^0.8.0",
"mongodb-build-info": "^1.2.0",
"mongodb-runner": "^4.8.3",
"node-loader": "^0.6.0",
Expand Down
84 changes: 81 additions & 3 deletions snippets/stage-autocompleter.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,42 @@
],
"description": "Returns a count of the number of documents at this stage of the aggregation pipeline."
},
"MongoDB Aggregations $densify": {
"prefix": "$densify",
"body": [
"/**",
" * field: The required field to densify.",
" * partitionByFields: The set of fields that acts as a compound key to define each partition.",
" * range: {",
" * step: The amount to increment the field value in each document.",
" * unit: If specified field must evaluate to a date for every document in the collection, otherwise must evaluate to a numeric.",
" * bounds: A string or array of numeric/date bounds, corresponding to the type of the field.",
" * }",
" */",
"\\$densify: {",
" field: ${1:string},",
" partitionByFields: [${2:string}, ${3:string}, ...],",
" range: {",
" step: ${4:number},",
" unit: ${5:string},",
" bounds: [${6:lowerbound}, ${7:upperbound}, ...]",
" }",
"}"
],
"description": "Creates new documents to eliminate the gaps in the time or numeric domain at the required granularity level."
},
"MongoDB Aggregations $documents": {
"prefix": "$documents",
"body": [
"/**",
" * expression: Any valid expression.",
" */",
"\\$documents: {",
" ${1:expression}",
"}"
],
"description": "Returns literal results for a full-text search."
},
"MongoDB Aggregations $facet": {
"prefix": "$facet",
"body": [
Expand Down Expand Up @@ -318,7 +354,7 @@
"prefix": "$search",
"body": [
"/** ",
" * index: the name of the Search index.",
" * index: The name of the Search index.",
" * text: Analyzed search, with required fields of query and path, the analyzed field(s) to search.",
" * term: Un-analyzed search.",
" * compound: Combines ops.",
Expand All @@ -337,6 +373,48 @@
],
"description": "Performs a full-text search on the specified field(s)."
},
"MongoDB Aggregations $searchMeta": {
"prefix": "$searchMeta",
"body": [
"/**",
" * index: The name of the Search index.",
" * count: The count of the results.",
" * facet: {",
" * operator: Analyzed search, with required fields of query and path, can either be replaced with the name of a valid operator.",
" * facets: {",
" * stringFacet: Narrows search results based on unique string values, with required fields of type and path.",
" * numberFacet: Narrows search results by breaking them up into separate ranges of numbers, with required fields of type, path, and boundaries.",
" * dateFacet: Narrows search results by breaking them up into separate ranges of dates, with required fields of type, path, and boundaries.",
" * }",
" * }",
" */",
"\\$searchMeta: {",
" index: ${1:string},",
" facet: {",
" operator: {",
" text: {",
" query: ${2:string},",
" path: ${3:string}",
" }",
" },",
" facets: {",
" ${4:stringFacet}: {",
" type: ${5:string},",
" path: ${6:string},",
" numBuckets: ${7:integer}",
" },",
" numberFacet: {",
" type: 'number',",
" path: ${8:string},",
" boundaries: [${9:lowerbound}, ${10:upperbound}, ...],",
" default: ${11:string}",
" }",
" }",
" }",
"}"
],
"description": "Performs a full-text search on the specified field(s) and gets back only the generated search meta data from a query."
},
"MongoDB Aggregations $set": {
"prefix": "$set",
"body": [
Expand Down Expand Up @@ -374,8 +452,8 @@
" ${3:path}: {",
" ${4:function}: ${5:functionArgs},",
" window: {",
" documents: [${6:lowerBound}, ${7:upperBound}],",
" range: [${8:lowerBound}, ${9:upperBound}],",
" documents: [${6:lowerbound}, ${7:upperbound}],",
" range: [${8:lowerbound}, ${9:upperbound}],",
" unit: ${10:string}",
" }",
" },",
Expand Down