IBM Support

How to connect to MongoDB

How To


Summary

Introducing the MongoDB settings required to create a connection from CPD to MongoDB.

Steps

  1. Create database on MongoDB

    Connect to MongoDB shell.
    mongo shell

    Create "testdb" database.
    create db

    Create "user" collection and insert it to "testdb".
    create collection
     
  2. User Settings

    Connect to admin db.
    connect to admin db

    Create user administrator.
    create user

    Register MongoDB instance to enable the authentication/authorization function. Add --auth option when running mongod.
    restart

    Connect to MongoDB with the user administrator created in the above step.
    connect

    Create a user for the database "testdb" created in the above step.
    create user
     
  3. Create connection to MongoDB on CPD

    Set the required information.
    image 10981

Document Location

Worldwide

[{"Type":"MASTER","Line of Business":{"code":"LOB10","label":"Data and AI"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSHGYS","label":"IBM Cloud Pak for Data"},"ARM Category":[{"code":"a8m3p000000UoR7AAK","label":"Administration-\u003EConnections"}],"ARM Case Number":"","Platform":[{"code":"PF040","label":"Red Hat OpenShift"}],"Version":"3.0.1;3.5.0"}]

Document Information

Modified date:
22 August 2023

UID

ibm16473625