} </style>
A robust, scalable, highly available document database solution that enables developers and supports mission-critical enterprise deployments.
IBM Data Management Platform for MongoDB Enterprise Advanced is a data platform and document database that enables developers to build apps faster and distribute data to where it needs to be, with the freedom to run anywhere. This modern database platform provides a rich data environment and enterprise tooling to support mission-critical, highly secure and always-on deployments.
Launch the application and Login into it. It will basically create a server connection on the API server side. The following API is called and a POST method is used to login:
POST http://localhost:3000/api/login Content-Type: application/json { "username": "", "password": "", "hosts": [ { "host": "localhost", "port": 27017 } ] }
- Response:
{ "success" : true, "token": "TOKEN" }
Login
Clicking on Login
will perform a POST
request to establish a connection to the MongoDB Operator.
CRUD operations create, read, update, and delete
Create or insert operations add new documents to a collection. If the collection does not currently exist, insert operations will create the collection.
MongoDB provides the following methods to insert documents into a collection:
-
db.collection.insertOne()
-
db.collection.insertMany()
In MongoDB, insert operations target a single collection
. All
write operations in MongoDB are atomic
on the level of a single
document
.
db.inventory.insertOne( { item: "canvas", qty: 100, tags: ["cotton"], size: { h: 28, w: 35.5, uom: "cm" } } )
Insert
Clicking on Insert
will perform a POST
request to the already established MongoDB connection and insert data into the database.
Read operations retrieve documents
from a collection
; i.e. query a collection for
documents. MongoDB provides the following methods to read documents from
a collection:
db.collection.find()
You can specify query filters or criteria
that identify the documents to return.
db.inventory.find( { item: "canvas" } )
Read
Clicking on Read
will perform a GET
request to the already established MongoDB connection and get data from the database.
Update operations modify existing documents
in a collection
. MongoDB
provides the following methods to update documents of a collection:
-
db.collection.updateOne()
-
db.collection.updateMany()
-
db.collection.replaceOne()
In MongoDB, update operations target a single collection. All write
operations in MongoDB are atomic
on the level of a single document.
You can specify criteria, or filters, that identify the documents to
update. These :ref:filters
use the same
syntax as read operations.
db.inventory.updateOne( { item: "canvas" }, { $set: { "size.uom": "cm", status: "P" }, $currentDate: { lastModified: true } } )
Update
Clicking on Update
will perform a PUT
request to the already established MongoDB connection and update the data in the database.
Delete operations remove documents from a collection. MongoDB provides the following methods to delete documents of a collection:
-
db.collection.deleteOne()
-
db.collection.deleteMany()
In MongoDB, delete operations target a single :term:collection
. All
write operations in MongoDB are atomic
on the level of a single document.
You can specify criteria, or filters, that identify the documents to
remove. These filters
use the same
syntax as read operations.
db.inventory.removeOne({})
Delete
Clicking on Delete
will perform a DELETE request to the already established MongoDB connection and delete the data from the database.
POST http://localhost:3000/api/logout X-TOKEN: TOKEN
Response:
{ "success" : true }
Logout
Clicking on Logout
will perform a POST
request to the already established MongoDB connection and will end the session with the MongoDB Operator.
This sample application helps you explore CRUD
operations with a sample react application →
Sample Application 1