MongoDB CRUD Operations Start mongo Available commands help Available collections show collections See current database db See all available databases show databases Create and use new database use databasename Create Insert data db.’collectionname’.insert({‘JS object here}) Read Preview collection db.’collectionname’.find() Finds elements with certain key-value property db.’collectionname’.find({ ‘key’: ‘value’}) Update Update one element db.’collectioname’.upadateOne({‘key’: ‘value’}, {$set: {‘key’: ‘value’, ‘key1’: ‘value1’}} Update many elements db.’collectionname’.updateMany({‘key’:’value’}, {$set: {‘key: ‘value’, ‘key’: ‘value’}}) Delete/ Destroy Delete one element db.’collectionname’.deleteOne({‘key’: ‘value’}) Delete many elements db.’collectionname’.deleteMany({‘key: ‘value’}) Delete entire collection db.’collectionname’.deleteMany({}) Comparison operators $gt - greater $gte - greater or equal $lt - less than $lte - less than or equal Logical operators $and $not $nor $or