DEV Community

niirjhor
niirjhor

Posted on

CRUD Operations

The terms CRUD (create, read, update, and delete) stand for create, read, update, and delete. The four basic roles of persistent storage are as follows.
CREATE procedures: To create a new record, use the INSERT command. In the SQL relational database application, the Create function is called INSERT. In Oracle HCM Cloud, it is called create.
• db.collection.insertOne() New in version 3.2 in MongoDB
• db.collection.insertMany() New in version 3.2 in MongoDB

READ procedures: The primary keynoted within the input parameter is used to read the table records. The read function is like a search function
• db.collection.find()

UPDATE procedures: Executes a UPDATE statement on the table based on the primary key supplied for a record in the WHERE clause. The update function is used to modify existing records that exist in the database. To fully change a record, users may have to modify information in multiple fields.
• db.collection.updateOne() New in version 3.2 in MongoDB
• db.collection.updateMany() New in version 3.2 in MongoDB
• db.collection.replaceOne() New in version 3.2 in MongoDB

DELETE procedures: In the WHERE clause, deletes a specific record. The delete function allows users to remove records from a database that is no longer needed.
• db.collection.deleteOne() New in version 3.2 in MongoDB
• db.collection.deleteMany() New in version 3.2 in MongoDB

Top comments (0)