3.6.2. Loading data into the database
After you have deployed the mongodb-nationalparks database application, load the national park location information into the database.
Prerequisites
-
You have deployed the
nationalparksback-end application. -
You have deployed the
mongodb-nationalparksdatabase application.
Procedure
Load the national parks data by running the following command:
$ oc exec $(oc get pods -l component=nationalparks | tail -n 1 | awk '{print $1;}') -- curl -s http://localhost:8080/ws/data/loadExample output
"Items inserted in database: 2893"
Verification
Verify that the map data was loaded properly by running the following command:
$ oc exec $(oc get pods -l component=nationalparks | tail -n 1 | awk '{print $1;}') -- curl -s http://localhost:8080/ws/data/allExample output (trimmed)
... , {"id": "Great Zimbabwe", "latitude": "-20.2674635", "longitude": "30.9337986", "name": "Great Zimbabwe"}]