0

I'm wondering what the best to seed an initial MongoDB database with a Spring Boot application using JSON files. I have about 7 JSON files that need to be translated into 7 separate collections in the same MongoDB database. The JSON files are huge! Most of the examples I have found are for SQL databases, or show manually writing out each object in a seed file.

I'm currently using node to seed the database, then connecting the SpringBoot API to the already created database.

Any suggestions on how I could get rid of the Node DB seeder?

1 Answer 1

1

you could try to use mongoimport (assuming the JSON data is clean)

https://docs.mongodb.com/manual/reference/program/mongoimport/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.