Posts

DBL CODE BY BeAsT

use pragya// this will create as well as use the database db.createCollection("test")// this will create a table show dbs//to show all the databases show collections//to show all the tables //insert,delete,update //insert can be done in two ways ,insertOne,insertMany db.test.insertOne({Name:"Ayushi",Age:"20",RegNo:"45782"}) db.test.insertMany([{Name:"Pragya",Age:"70"},{Name:"Ayush",Age:"20",RegNo:"4578",Brain:"100%"},{Name:"Nazia",Age:"20",RegNo:"452",Brain:"0%"}]) db.test.updateOne({Name:"Ayushi"},{$set:{Age:"21"}}) db.test.updateOne({Name:"Ayushi"},{$set:{Name:"Abc"}}) db.test.find()//for showing the tuples of the table same as select* from table in SQL db.test.updateMany({Age:"20"},{$set:{Brain:"100%"}}); db.test.find().pretty()// to show the content in formtted manner db.test.findOne({...