Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Databases

dylan kane
dylan kane
2,772 Points

Is there another way to insert data in a MongoDB document?

So I am making a site where there is a mongo database of a bunch of video games and their characteristics. I really do not want to insert every one of these through my terminal or dev console on chrome. I feel these way are very inefficient, and the data doesn't even seem to stay with the project. An example would be if I had the project on Github and forwarded it to a c9.io project, the database would not come with it. How should I go about solving these problems?

2 Answers

Seth Kroger
Seth Kroger
56,413 Points

The mongoimport command can import data that's in JSON, CSV, or TSV formats.

jason chan
jason chan
31,009 Points

https://docs.c9.io/docs/setting-up-mongodb

There is youtube video also below on mean stack setup with c9.

https://youtu.be/lcoVzLp1g-o

dylan kane
dylan kane
2,772 Points

ok but what about the main question about alternative ways of entering data into the db