简体   繁体   中英

What kind of tools are available for populating test data into mongodb

What kind of tools are available for populating test data in mongodb. We have used dbunit in the past, but it doesn't seem to have an equivalent maven plugin.

First question is from what source you want load data? From another mongodb, from sql, from xml, from text file, etc..

As for me, i using some helper classes(one per each my mongo document) thats create some entity, that i need during testing. Also i have one test class per each my business object, and before test start i run helpers in order to create test environment, after test finished i delete all created data. Such approach work even at production database.

I can suggest another approch. For example if you have some production mongo db with data you can copy mongo data, run new mongo db on this data and run your tests and after tests has finished, delete this db.

http://eliothorowitz.com/post/459890033/streaming-twitter-into-mongodb how does this look? Now all you need is a JSON or CSV generator which is much easier to be found.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM