migrate/database/mongodb
Alex Pliutau e877644ed1 Fix MongoDB docs: x-migrations-collection (#225) 2019-05-22 18:29:44 -07:00
..
examples/migrations postgres: Move lock out of ensureVersionTable, for consistency with other SQL operations (#173) 2019-02-26 15:56:57 -08:00
README.md Fix MongoDB docs: x-migrations-collection (#225) 2019-05-22 18:29:44 -07:00
mongodb.go postgres: Move lock out of ensureVersionTable, for consistency with other SQL operations (#173) 2019-02-26 15:56:57 -08:00
mongodb_test.go Enabled maligned, staticcheck and errcheck linters (#206) 2019-04-26 15:47:16 -07:00

README.md

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

URL Query WithInstance Config Description
x-migrations-collection MigrationsCollection Name of the migrations collection
x-transaction-mode TransactionMode If set to true wrap commands in transaction. Available only for replica set. Driver is using strconv.ParseBool for parsing
dbname DatabaseName The name of the database to connect to
user The user to sign in as. Can be omitted
password The user's password. Can be omitted
host The host to connect to
port The port to bind to