Skip to content

Commit 2f35f3e

Browse files
committed
format
1 parent 1277e5a commit 2f35f3e

File tree

4 files changed

+29
-6
lines changed

4 files changed

+29
-6
lines changed

.github/workflows/docs-deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
- name: Checkout repository
1515
uses: actions/checkout@master
1616

17-
- name: Install Node v16
17+
- name: Install Node v17
1818
uses: actions/setup-node@master
1919
with:
20-
node-version: 16
20+
node-version: 17
2121

2222
- name: Install dependencies
2323
run: npm install

.github/workflows/eslint.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ on:
88
- '*'
99
jobs:
1010
test:
11-
name: ESLint (Node v16)
11+
name: ESLint
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Checkout repository
1515
uses: actions/checkout@v2
1616

17-
- name: Install Node v16
17+
- name: Install Node v17
1818
uses: actions/setup-node@v1
1919
with:
20-
node-version: 16
20+
node-version: 17
2121

2222
- name: Install dependencies
2323
run: yarn install

.github/workflows/npm-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- uses: actions/checkout@v2
1313
- uses: actions/setup-node@v1
1414
with:
15-
node-version: 16
15+
node-version: 17
1616
registry-url: https://registry.npmjs.org/
1717
- run: npm install
1818
- run: npm run build

src/Database.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,29 @@ export class Database<T = unknown, PAR = unknown> extends TypedEmitter<QmEvents<
460460
});
461461
}
462462

463+
/**
464+
* The db metadata
465+
* @type {?Object}
466+
*/
467+
public get metadata() {
468+
if (!this.model) return null;
469+
return {
470+
name: this.model.collection.name,
471+
db: this.model.collection.dbName,
472+
namespace: this.model.collection.namespace
473+
};
474+
}
475+
476+
/**
477+
* Returns database statistics
478+
* @returns {Promise<CollStats>}
479+
*/
480+
public async stats() {
481+
this.__readyCheck();
482+
const stats = await this.model.collection.stats();
483+
return stats;
484+
}
485+
463486
/**
464487
* Close the database connection
465488
* @param {?boolean} [force=false] Close forcefully

0 commit comments

Comments
 (0)