Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 740
Jason Avatar asked Nov 06 '22 05:11

Jason


2 Answers

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.

like image 101
chx Avatar answered Nov 10 '22 17:11

chx


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.

like image 21
Andrew Orsich Avatar answered Nov 10 '22 17:11

Andrew Orsich