Skip to content

Commit 732d1ed

Browse files
authored
fix(shell-api): make db.stats() return stats for current db MONGOSH-555 (#585)
1 parent 661fcc8 commit 732d1ed

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/shell-api/src/database.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1691,7 +1691,7 @@ describe('Database', () => {
16911691
await database.stats(1);
16921692

16931693
expect(serviceProvider.runCommandWithCheck).to.have.been.calledWith(
1694-
ADMIN_DB,
1694+
database._name,
16951695
{
16961696
dbStats: 1,
16971697
scale: 1
@@ -1703,7 +1703,7 @@ describe('Database', () => {
17031703
await database.stats();
17041704

17051705
expect(serviceProvider.runCommandWithCheck).to.have.been.calledWith(
1706-
ADMIN_DB,
1706+
database._name,
17071707
{
17081708
dbStats: 1,
17091709
scale: 1

packages/shell-api/src/database.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ export default class Database extends ShellApiClass {
825825
@returnsPromise
826826
async stats(scale = 1): Promise<Document> {
827827
this._emitDatabaseApiCall('stats', { scale: scale });
828-
return await this._runAdminCommand(
828+
return await this._runCommand(
829829
{
830830
dbStats: 1,
831831
scale: scale

0 commit comments

Comments
 (0)