mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-26 16:46:00 +00:00
row count info added to mongoDB
This commit is contained in:
@@ -8,9 +8,12 @@ class Analyser extends DatabaseAnalyser {
|
|||||||
async _runAnalysis() {
|
async _runAnalysis() {
|
||||||
const collections = await this.pool.__getDatabase().listCollections().toArray();
|
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({
|
const res = this.mergeAnalyseResult({
|
||||||
collections: collections.map((x) => ({
|
collections: collections.map((x, index) => ({
|
||||||
pureName: x.name,
|
pureName: x.name,
|
||||||
|
tableRowCount: stats[index].count,
|
||||||
})),
|
})),
|
||||||
});
|
});
|
||||||
// console.log('MERGED', res);
|
// console.log('MERGED', res);
|
||||||
|
|||||||
Reference in New Issue
Block a user