First, follow my article on the SAP Cloud platform to assign your account Mongbodb service: How to add a new service under cloud Foundry environment of SAP cloud Platform
Then download the SAP-provided sample program from this link.
1. Use the command line CF marketplace to view the version number of MongoDB for the current SAP Cloud Platform: On the SAP Cloud Platform I use is V3.0-dev
Create a service instance using the following command line:
CF Create-service MongoDB V3.0-dev mongo-service
2. To the root directory of the example program, use the command MVN package:
The command generates a Hcp-cf-mongodb-tutorial-1.0-snapshot.jar:
3. Edit Manifest.yml to specify the name of the program deployed to the SAP Cloud Platform:
4. CF push for deployment.
After successful deployment, you can see that the app is in started state in cockpit:
To access the app, you can see the following output:
This output is generated by Rootcontroller:
To get more original Jerry's technical articles, please follow the public number "Wang Zixi" or scan the QR code below:
How to use MongoDB services on the SAP cloud Platform