1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/getting-started-cli-load-data-output.adoc

48 lines
1.2 KiB
Plaintext

// Module included in the following assemblies:
//
// * tutorials/dev-app-cli.adoc
:_mod-docs-content-type: PROCEDURE
[id="getting-started-cli-load-data-output_{context}"]
= Loading data into the database
After you have deployed the `mongodb-nationalparks` database, you can load the national park location information into the database.
.Prerequisites
* You have deployed the `nationalparks` back-end application.
* You have deployed the `mongodb-nationalparks` database application.
.Procedure
* Load the national parks data by running the following command:
+
[source,terminal]
----
$ oc exec $(oc get pods -l component=nationalparks | tail -n 1 | awk '{print $1;}') -- curl -s http://localhost:8080/ws/data/load
----
+
.Example output
+
[source,text]
----
"Items inserted in database: 2893"
----
.Verification
* Verify that the map data was loaded properly by running the following command:
+
[source,terminal]
----
$ oc exec $(oc get pods -l component=nationalparks | tail -n 1 | awk '{print $1;}') -- curl -s http://localhost:8080/ws/data/all
----
+
.Example output (trimmed)
+
[source,terminal]
----
...
, {"id": "Great Zimbabwe", "latitude": "-20.2674635", "longitude": "30.9337986", "name": "Great Zimbabwe"}]
----