Options
All
  • Public
  • Public/Protected
  • All
Menu

mongoback - DEV - v3.0.2

Index

Type aliases

The type whose instance can be in the "collections" option. It can be a SpecificCollections instance, that specifies collections in the scope of their database, or it can be a GeneralCollection instance, that specifies collections without specifying their database.

Collections: Collection | Collection[]

The type of the "collections" option. It defines the collections that will be exported.

Database: string | RegExp | DetailedDatabase | LambdaDatabase

A type whose instances can be in the "databases" option. It can be a string, a RegExp, an DetailedDatabase or a LambdaDatabase. If it is a string, all databases equals to that string will be exported. If it is a RegExp, all databases matching that RegExp will be exported. If it is an DetailedDatabase, all databases matching its "databases" property will be exported with the object ExportingOptions overwriting the derault ones. If it is a LambdaDatabase, all databases that passed to that function return a truthy value will be exported, with the eventual ExportingOptions returned overwriting the default ones.

Databases: Database | Database[]

The type of the "databases" option. It is a [[GeneralDatabase]] instance or an array of [[GeneralDatabase]] and all databases matching those instances will be exported.

DetailedCollection: { match: string | RegExp } & ExportingOptions

An object whose instances can be in the "collections" option. The property "match" must be specified. If it is a string, all collections equals to that string will be exported. If it is a RegExp, all collections matching that RegExp will be exported. The other properties are the ExportingOptions exporting options that overwrite the default ones.

DetailedDatabase: { match: string | RegExp } & ExportingOptions

An object whose instances can be in the "databases" option. The property "match" must be specified. If it is a string, all databases equals to that string will be exported. If it is a RegExp, all databases matching that RegExp will be exported. The other properties are the ExportingOptions exporting options that overwrite the default ones.

DetailedGeneralCollections: { collections: GeneralCollection[] } & ExportingOptions

The type whose instances can be values of the SpecificCollections keys. It is an object with a property "collections", which is an array of GeneralCollection that defines which collections of the database will be exported. The other properties are ExportingOptions that will overwrite the default ones for these collections.

ExportingCollection: { name: string } & ExportingOptions

A type representing a collection to be exported. The name property is the string name of the collection, the other properties are the ExportingOptions of the collection.

ExportingFileName: string | ((db: string, collection: string, type: "json" | "csv") => string)

The function type that can be used as value of the "fileName" option.

param db

The database of the collection that will be exported

param collection

The the collection that will be exported

param type

The type of the collection that will be exported

returns

The file name of the exported collection

ExportingFilePath: string | ((db: string, collection: string, type: "json" | "csv", outPath: string) => string)

The function type of that can be used as value of the "filePath" option.

param db

The database of the collection that will be exported

param collection

The the collection that will be exported

param type

The type of the collection that will be exported

param outPath

The file path of the exported collection if this function was not specified

returns

The file path of the exported collection

The options about how the collections will be exported. They will define both the options of the mongoexport command and others not regarding it.

See the mongoexport official documentation to further information.

see

https://docs.mongodb.com/manual/reference/program/mongoexport/ to further information on the mongoexport options.

GeneralCollection: string | RegExp | DetailedCollection | LambdaCollection

A type whose instances can be in the "collections" option. It can be a string, a RegExp, an DetailedCollection or a LambdaCollection. If it is a string, all collections equals to that string will be exported. If it is a RegExp, all collections matching that RegExp will be exported. If it is an DetailedCollection, all collections matching its "collections" property will be exported with the object ExportingOptions overwriting the derault ones. If it is a LambdaCollection, all collections that passed to that function return a truthy value will be exported, with the eventual ExportingOptions returned overwriting the default ones.

GeneralCollections: GeneralCollection | GeneralCollection[]

A type that can be passed as value of the "collections" option. It is a GeneralCollection instance or an array of GeneralCollection and all collections matching those instances will be exported.

LambdaCollection: (db: string, collection: string) => boolean | ExportingOptions

Type declaration

    • A callback type whose instances can be in the "collections" option. All the databases and collections will be passed to this callback and if true or an ExportingOptions object with further options are returned, the collection will be exported.

      Parameters

      • db: string

        The database token in consideration

      • collection: string

      Returns boolean | ExportingOptions

      If true the collection will be exported with default exporting options. If an ExportingOptions object with further options the collection will be exported with that options. If false, null or undefined the collection will not be exported.

LambdaDatabase: (db: string) => boolean | ExportingOptions

Type declaration

    • A callback type whose instances can be in the "databases" option. All the databases will be passed to this callback and if true or an ExportingOptions object with further options are returned, the database will be exported.

      Parameters

      • db: string

        The database token in consideration

      Returns boolean | ExportingOptions

      If true the database will be exported with default exporting options. If an ExportingOptions object with further options the database will be exported with that options. If false, null or undefined the database will not be exported.

LogType: "base" | "command" | "mongoexport" | "expectedCollections" | "actualCollections"

The various log modes

LogTypes: LogType[]

An array of LogType

The options of the mongoexport function.

Some of the properties are exactly the same of the mongoexport options. Some are slightly modified to allow a more confortable usage, without changing what will be passed as a mongoexport option. The default value of those option does not corrispond with the mongoexport one. When there is a value set to false or undefined, it means that the option is not added to the mongoexport command, not that it is the default value of mongoexport.

To support the old versions of mongoexport, there are also the deprecated options.

See the mongoexport official documentation to further information.

see

https://docs.mongodb.com/manual/reference/program/mongoexport/ to further information on the mongoexport options.

Functions

  • The function to export collections from a mongodb. You can specify the mongodb collection, the collections that will be exported, how they will be exported and where.

    Parameters

    • Optional options: Options

      The options to specify how, where and what will be exported.

    Returns Promise<ExportResult>

Generated using TypeDoc