Maven plugin for MongoDB migrations
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/main/java/pl/coderion/mongodb
.gitignore
.travis.yml
LICENSE
README.md
pom.xml

README.md

mongeez-maven-plugin

Maven plugin for MongoDB migrations (uses Mongeez)

Current version: 0.9.3

Usage

  1. Add build plugin dependency to your POM

    <build>
        <plugins>
            <plugin>
                <groupId>pl.coderion.mongodb</groupId>
                <artifactId>mongeez-maven-plugin</artifactId>
                <version>0.9.3</version>
                <configuration>
                    <dbName>test</dbName>
                    <changeLogFile>src/main/mongeez/mongeez.xml</changeLogFile>
                </configuration>
            </plugin>
        </plugins>
    </build>
  2. Run maven goal:

    mvn mongeez:update
    

Configuration

  • optional db authentication
    <configuration>
        <dbName>test</dbName>
        <dbAuth>true</dbAuth>
        <username>foo</username>
        <password>bar</password>
        <changeLogFile>src/main/mongeez/mongeez.xml</changeLogFile>
    </configuration>
  • changeLogFile

    Create mongeez.xml with all change logs. See how to use mongeez.

    Example changelog file:

    <?xml version="1.0" encoding="UTF-8"?>
    <mongoChangeLog>
        <changeSet changeId="1st change" author="coderion">
            <script>
                db.foo.createIndex({"foo": 1});
            </script>
        </changeSet>
        <changeSet changeId="2nd change" author="coderion">
            <script>
                db.foo.update({"foo": "bar"}, { $set: {"some": "any" } }, { multi: true });
            </script>
        </changeSet>
    </mongoChangeLog>

Travis Continuous Integration Build Status

Build Status

License

Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0