embedmongo-maven-plugin icon indicating copy to clipboard operation
embedmongo-maven-plugin copied to clipboard

Ease of use mongo-import goal

Open yacota opened this issue 8 years ago • 2 comments

In https://github.com/joelittlejohn/embedmongo-maven-plugin/issues/48 an easier way to import collections has been implemented, but I also think that being able to point to a "directory" instead of a single file(or list, whatever) would definetly increase the ease of use of this goal

<execution>
                <id>mongo-import</id>
                <phase>process-test-resources</phase>
                <goals>
                  <goal>mongo-import</goal>
                </goals>
                <configuration>
                  <imports>
                    <import>
                      <database>${mongodb.database.name}</database>
                      <file>${basedir}/src/test/resources/mongodata</file>
                    </import>
                  </imports>
                </configuration>
              </execution>

In mongodata I have a few dozen of json files which are created by following the convention described in issue https://github.com/joelittlejohn/embedmongo-maven-plugin/issues/48.

yacota avatar Nov 11 '15 10:11 yacota

Sounds good to me. I don't think we need to search directories recursively (this can introduce new edge-cases and issues) but definitely iterating every file in a given directory would be good.

Happy to accept a pull request for this if you have the time.

joelittlejohn avatar Nov 11 '15 13:11 joelittlejohn

Ah, I just saw your pull request! :smiley:

joelittlejohn avatar Nov 11 '15 13:11 joelittlejohn