Redgate Flyway

For PostgreSQL users - where are your DBs hosted?

MongoDB - Native Connectors

  • Status: Preview
  • Verified Versions: V5,V8
  • Maintainer: Redgate

Supported Versions and Support Levels

Terminology

We have to map Flyway concepts and language rooted in the relational database world to MongoDB - this is how Flyway sees the mapping:

MongoDB Concept Flyway Concept
database database/schema
collection table
row document
transaction transaction

Using Flyway with MongoDB Native Connectors

  • If you are using javascript migrations then you'll need mongosh to be installed. If you are not using the default database, you will need to include the database name and auth source in your url.
  • Any configuration you require needs to go into the connection string (Flyway's URL parameter) - see Mongo Connection String Options. This is to enable the same configuration to be applied whether Flyway is talking to the database through the API or via Mongosh.
  • There is a tutorial available here.

Limitations

  • Transactions using .js migrations will not work. A warning will be displayed if executeInTransaction is set. See this blog post for more details.

Didn't find what you were looking for?