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
2 changes: 2 additions & 0 deletions packages/shell-api/src/integration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2146,8 +2146,10 @@ describe('Shell API (integration)', function() {
expect(params.connectionInfo().is_localhost).to.equal(true);
expect(await database._getCollectionNames()).to.deep.equal(['docs']);
expect(await params.getCollectionCompletionsForCurrentDb('d')).to.deep.equal(['docs']);
expect(await params.getCollectionCompletionsForCurrentDb('D')).to.deep.equal(['docs']);
expect(await params.getCollectionCompletionsForCurrentDb('e')).to.deep.equal([]);
expect(await params.getDatabaseCompletions('test-')).to.deep.equal([database.getName()]);
expect(await params.getDatabaseCompletions('TEST-')).to.deep.equal([database.getName()]);
});
});
});
Expand Down
6 changes: 4 additions & 2 deletions packages/shell-api/src/shell-instance-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,8 @@ export default class ShellInstanceState {
getCollectionCompletionsForCurrentDb: async(collName: string): Promise<string[]> => {
try {
const collectionNames = await this.currentDb._getCollectionNamesForCompletion();
return collectionNames.filter((name) => name.startsWith(collName));
return collectionNames.filter((name) =>
name.toLowerCase().startsWith(collName.toLowerCase()));
} catch (err) {
if (
err.code === ShellApiErrors.NotConnected ||
Expand All @@ -356,7 +357,8 @@ export default class ShellInstanceState {
getDatabaseCompletions: async(dbName: string): Promise<string[]> => {
try {
const dbNames = await this.currentDb._mongo._getDatabaseNamesForCompletion();
return dbNames.filter((name) => name.startsWith(dbName));
return dbNames.filter((name) =>
name.toLowerCase().startsWith(dbName.toLowerCase()));
} catch (err) {
if (
err.code === ShellApiErrors.NotConnected ||
Expand Down