Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
21 changes: 0 additions & 21 deletions packages/mongodb-constants/src/filter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,26 +208,5 @@ describe('completer', function () {
}
});
});

it('should include $$IDX system variable gated to MongoDB 8.3+', function () {
const idx = ALL_CONSTANTS.find((c) => c.value === '$$IDX');
expect(idx).to.exist;
expect(idx?.version).to.eq('8.3.0');
expect(idx?.meta).to.eq('variable:system');
});

it('should return $$IDX for server 8.3+ but not for older servers', function () {
const withIdx = getFilteredCompletions(
{ serverVersion: '8.3.0' },
ALL_CONSTANTS,
).map((c) => c.value);
expect(withIdx).to.include('$$IDX');

const withoutIdx = getFilteredCompletions(
{ serverVersion: '8.2.0' },
ALL_CONSTANTS,
).map((c) => c.value);
expect(withoutIdx).to.not.include('$$IDX');
});
});
});
9 changes: 0 additions & 9 deletions packages/mongodb-constants/src/system-variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,6 @@ const SYSTEM_VARIABLES = [
version: '3.0.0',
description: 'One of the allowed results of a `$redact` expression.',
},
{
name: '$$IDX',
value: '$$IDX',
score: 1,
meta: 'variable:system',
version: '8.3.0',
description:
'A variable that references the index of the current array element in $map, $filter, and $reduce expressions. Use arrayIndexAs to specify a custom name instead.',
},
{
name: '$$PRUNE',
value: '$$PRUNE',
Expand Down
13 changes: 0 additions & 13 deletions packages/mongodb-ts-autocomplete/src/autocompleter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,19 +321,6 @@ service host, so typescript wouldn't load all the dependencies.
}
});

it('suggests arrayIndexAs inside $filter, $map, $reduce operators', async function () {
const operators = ['$filter', '$map', '$reduce'] as const;
for (const op of operators) {
const completions = await autocompleter.autocomplete(
`db.foo.aggregate([{ $project: { result: { ${op}: { array`,
);
const names = completions.map((c) => c.name);
expect(names, `${op} should suggest arrayIndexAs`).to.include(
'arrayIndexAs',
);
}
});

describe('getConnectionSchemaCode', function () {
it('generates code for a connection', async function () {
const docs = [
Expand Down
28 changes: 0 additions & 28 deletions packages/mql-typescript/out/schema.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading