Prac 2

 2A)show dbs

use Krish

2B)db.createCollection("emp")

2C)use Krish


db.createcollection("emp")


db.emp.insertMany([{"Name":"Krish","Age":20,"email_id":"krish123@gmail.com"},{"Name":"Trish","Age":21,"email_id":"trish123@gmail.com"},{"Name":"Hrish","Age":22,"email_id":"hrish123@gmail.com"},{"Name":"Vrish","Age":23,"email_id":"vrish123@gmail.com"}])

2D)db.emp.countDocuments()

2E)db.emp.find()

2F)db.emp.find({Name:"Krish"})

2G)db.emp.updateOne({Name:"Krish"},{$set:{Age:24})

2H)db.emp.deleteOne({Name:"Trish"})


2I)db.emo.drop()

Comments

Popular posts from this blog

Prac 5

Prac 1