migrate/database/mongodb
Dale Hui 52fc08fdf5 Update supported DB versions 2019-01-12 16:13:26 -08:00
..
examples added mongodb driver 2019-01-01 11:14:27 +03:00
README.md Replaced bsonx.Doc with bson.D 2019-01-04 22:01:21 +03:00
mongodb.go Add test for migrations in transaction mode 2019-01-06 12:45:22 +03:00
mongodb_test.go Update supported DB versions 2019-01-12 16:13:26 -08: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-table MigrationsTable Name of the migrations table
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