The constructor of the MongoScanner class. The params are the uri and options for the database connections. The connection is not established by the constructor, the connection parameters are only saved in the MongoScanner instance.
The string uri of the mongodb connection. Default: 'mongodb://localhost:27017'.
The options object of the mongodb connection. The npm mongodb module is used under the hood and this is the object provided to MongoClient. Default: { }.
The options that will be used as a fallback for the ScanOptions. For all the keys that will not be present in the options provided to a method that retrieves database or collections, the values provided here will be used instead of the default ones. Default: { }.
Clears the cache, which contains the results of the previous executions of the MongoScanner instance.
Closes an already open persistent connection.
Retrieves the schema of a mongodb database as a promise to a DatabaseSchema object.
The ScanOptions options.
A promise to a DatabaseSchema object representing the database schema. The keys are the databases and their values the collections of the database as an array of strings
Retrieves the collections of the specified database as a promise to an array of strings.
The database whose collections will be exported.
The ScanOptions options.
A promise to an array of strings containing the retrieved collections.
Retrieves the databases of a mongodb as a promise to an array of strings.
The ScanOptions options.
A promise to an array of strings containing the retrieved databases.
Starts a persistent connection to mongodb. By default, all methods that retrieve databases or collections from the mongodb open a connection before beginning and close it after finishing. This method allows you to have a persistent connection instead and is useful if you need to perform more than an operation and do not want to open and close connections for each of them.
Generated using TypeDoc
The MongoScanner class, to retrieve the database schema or to list databases and collections of a MongoDB database.