package
4.15.3
Repository: https://github.com/sfinks80/golang-migrate.git
Documentation: pkg.go.dev

# README

MongoDB

  • Driver work with mongo through db.runCommands
  • Migrations support json format. It contains array of commands for db.runCommand. Every command is executed in separate request to database
  • All keys have to be in quotes "
  • Examples

Usage

mongodb://user:password@host:port/dbname?query (mongodb+srv:// also works, but behaves a bit differently. See docs for more information)

URL QueryWithInstance ConfigDescription
x-migrations-collectionMigrationsCollectionName of the migrations collection
x-transaction-modeTransactionModeIf set to true wrap commands in transaction. Available only for replica set. Driver is using strconv.ParseBool for parsing
x-advisory-lockingtrueFeature flag for advisory locking, if set to false, disable advisory locking
x-advisory-lock-collectionmigrate_advisory_lockThe name of the collection to use for advisory locking.
x-advisory-lock-timeout15The max time in seconds that migrate will wait to acquire a lock before failing.
x-advisory-lock-timeout-interval10The max time in seconds between attempts to acquire the advisory lock, the lock is attempted to be acquired using an exponential backoff algorithm.
dbnameDatabaseNameThe name of the database to connect to
userThe user to sign in as. Can be omitted
passwordThe user's password. Can be omitted
hostThe host to connect to
portThe port to bind to

# Functions

No description provided by the author

# Constants

the default value for the advisory locking feature flag.
the collection to use for advisory locking by default.
the default maximum time to wait for a lock to be released.
the default maximum intervals time for the locking timout.
the name of the index which adds unique constraint to the locking_key field.

# Variables

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author