//INTRO
db.students.insertMany([
  { id: 1, name: 'Ryan', gender: 'M', info: {hasliscense : true, hascar:false} },
  { id: 2, name: 'Joanna', gender: 'F',info: {hasliscense : false, hascar:false}},
  { id: 3,  name:'Tom', gender:'M', info: {hasliscense:true,hascar:true}},
]);
db.students.find({ gender: 'F' });
db.students.find({'info.hasliscense':true});
db.students.find({'info.hascar':false});
db.students.find({gender: 'M'});

//CREATE
db.dishes.insert({name:'Roti',complimentary:'yes',price: 40})
db.dishes.find()
db.dishes.insertMany([
    {name:'Biryani',complimentary:'yes',price: 120},
    {name:'jamun',complimentary:'yes',price: 40},
    {name:'mojito',complimentary:'no',price: 80},
]);

//READ
db.dishes.findOne({complimentary: 'no'});
db.dishes.find({complimentary:'no'});
db.dishes.find({name:'Biryani'});
db.dishes.find()

//UPDATE
db.dishes.updateOne({name:'jamun'},{$set:{complimentary:'no'}})
db.dishes.find({name:'jamun'})
db.dishes.updateMany({complimentary:'no'},{$set:{complimentary:'yes'}})
db.dishes.find()
db.dishes.updateMany({price: 40},{$set:{price:70}})
db.dishes.find()
db.dishes.updateMany({price:{$lte:70}},{$set:{tip: 10}})
db.dishes.find()

//DELETE
db.dishes.deleteOne({name:'Roti'})
db.dishes.find()
db.dishes.deleteMany({price:{$gte:100}})
db.dishes.find()
db.dishes.find().count()

//SELECT COLUMN
db.dishes.insertMany([
    {name:'Fries',complimentary:'yes',price:40},
    {name:'momos',complimentary:'no',price:90},
]);
db.dishes.find({},{name:1,_id:0})

//DATA TYPES-TIMESTAMP & DATE
db.dishes.insertOne({name:'Tea',complimentary:'no',price:10,
                     foundedon:new Date(),
                     time:new Timestamp()
});
db.dishes.find()

//TO CHECK TYPE OF DATATYPES
typeof db.dishes.findOne.name
typeof db.dishes.findOne.complimentary

//DELETING A DATABASE COLLECTION
db.hotels.insertMany([{hehe:'angara',level:'high'},
                      {hehe:'sitara',level:'middle'},
                      {hehe:'shadab',level:'high'},
]);
db.hotels.find()
show collections
// db.dropDatabase()...entire database db will be dropped 
// show collections

db.dishes.drop() //dishes collection is only dropped/deleted
show collections

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: