diff --git a/packages/shell-api/src/integration.spec.ts b/packages/shell-api/src/integration.spec.ts index b8d63ef758..e56801c17c 100644 --- a/packages/shell-api/src/integration.spec.ts +++ b/packages/shell-api/src/integration.spec.ts @@ -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()]); }); }); }); diff --git a/packages/shell-api/src/shell-instance-state.ts b/packages/shell-api/src/shell-instance-state.ts index f1c353d671..9b7292030b 100644 --- a/packages/shell-api/src/shell-instance-state.ts +++ b/packages/shell-api/src/shell-instance-state.ts @@ -342,7 +342,8 @@ export default class ShellInstanceState { getCollectionCompletionsForCurrentDb: async(collName: string): Promise => { 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 || @@ -356,7 +357,8 @@ export default class ShellInstanceState { getDatabaseCompletions: async(dbName: string): Promise => { 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 ||