File tree Expand file tree Collapse file tree 1 file changed +16
-7
lines changed
packages/mongodb-ts-autocomplete/src Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -28,12 +28,7 @@ describe('MongoDBAutocompleter', function () {
2828 schemaInformationForAggregation : async ( ) => {
2929 const docs = [
3030 {
31- foo : 'foo' ,
32- bar : 1 ,
33- baz : {
34- a : 1 ,
35- b : 'b' ,
36- } ,
31+ aggField : 'foo' ,
3732 } ,
3833 ] ;
3934
@@ -93,7 +88,7 @@ describe('MongoDBAutocompleter', function () {
9388 ] ) ;
9489 } ) ;
9590
96- it ( 'completes a collection field name' , async function ( ) {
91+ it ( 'completes a collection field name in a query ' , async function ( ) {
9792 const completions = await autocompleter . autocomplete ( 'db.foo.find({ fo' , {
9893 connectionId : 'myConnection' ,
9994 databaseName : 'myDatabase' ,
@@ -117,4 +112,18 @@ describe('MongoDBAutocompleter', function () {
117112 } ,
118113 ] ) ;
119114 } ) ;
115+
116+ it ( 'completes a collection field name in an aggregation' , async function ( ) {
117+ const completions = await autocompleter . autocomplete (
118+ 'db.foo.aggregate([{ $match: { aggf' ,
119+ {
120+ connectionId : 'myConnection' ,
121+ databaseName : 'myDatabase' ,
122+ }
123+ ) ;
124+
125+ expect ( completions ) . to . deep . equal ( [
126+ { name : 'aggField' , kind : 'property' , type : 'string' } ,
127+ ] ) ;
128+ } ) ;
120129} ) ;
You can’t perform that action at this time.
0 commit comments