docker mongo code example
Example 1: mongodb docker
docker run -d -p 27017-27019:27017-27019 --name mongodb mongo:4.0.4
Example 2: how to import docker mongo data to local mongodb
#! /bin/bash
mongoimport --host mongodb --db test --collection census --type json --file /mongo-seed/census.json --jsonArray
Example 3: mongodb container mongodump openshift
01) To view all MongoDB environment variables, from local computer run:
oc exec mongodb-XX-XXXXX env