row count info added to mongoDB

This commit is contained in:
Jan Prochazka 2022-12-22 17:35:46 +01:00
parent 0e92d51f3c
commit b0d78250e1

View File

@ -8,9 +8,12 @@ class Analyser extends DatabaseAnalyser {
async _runAnalysis() {
const collections = await this.pool.__getDatabase().listCollections().toArray();
const stats = await Promise.all(collections.map((x) => this.pool.__getDatabase().collection(x.name).stats()));
const res = this.mergeAnalyseResult({
collections: collections.map((x) => ({
collections: collections.map((x, index) => ({
pureName: x.name,
tableRowCount: stats[index].count,
})),
});
// console.log('MERGED', res);