docker run -d -p 27017:27017 --name=demo mongo:latest
docker run -d -p 27017:27017 -e MONGO_INITDB_ROOT_USERNAME=rootUser -e MONGO_INITDB_ROOT_PASSWORD=rootPassword --name=demo mongo:latest --auth
spring.data.mongodb.uri=mongodb://rootUser:rootPassword@localhost:27017/oc.patient?authSource=admin
?authSource=admin: This part is crucial for authentication. It specifies the database where your credentials (rootUser and rootPassword) are stored. In this case, it's set to admin, a common practice.
curl --location --request POST 'http://localhost:8080/rice-production' --header 'Content-Type: application/json' --data-raw '{ "area": "Brazil", "year": "1900", "unit": "tonnes", "value": "50000", "flag": "A", "flagDescription": "Official figure" }'
curl --location --request GET 'http://localhost:8080/rice-production/area/Brazil'
curl --location --request GET 'http://localhost:8080/rice-production/662be9d22972e56692f5aa69'"# mogodb"