mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 07:56:01 +00:00
added plugins
This commit is contained in:
24
plugins/dbgate-plugin-mongo/src/backend/Analyser.js
Normal file
24
plugins/dbgate-plugin-mongo/src/backend/Analyser.js
Normal file
@@ -0,0 +1,24 @@
|
||||
const { DatabaseAnalyser } = require('dbgate-tools');
|
||||
|
||||
class Analyser extends DatabaseAnalyser {
|
||||
constructor(pool, driver) {
|
||||
super(pool, driver);
|
||||
}
|
||||
|
||||
async _runAnalysis() {
|
||||
const collections = await this.pool.__getDatabase().listCollections().toArray();
|
||||
|
||||
const res = this.mergeAnalyseResult(
|
||||
{
|
||||
collections: collections.map((x) => ({
|
||||
pureName: x.name,
|
||||
})),
|
||||
},
|
||||
(x) => x.pureName
|
||||
);
|
||||
// console.log('MERGED', res);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Analyser;
|
||||
Reference in New Issue
Block a user