Submit Search
Upload
Design and Implement any 5 query using MongoDB
•
0 likes
•
5 views
B
bhavesh lande
Follow
Design and Implement any 5 query using MongoDB
Read less
Read more
Engineering
Report
Share
Report
Share
1 of 2
Download Now
Download to read offline
Recommended
The Annual G20 Scorecard – Research Performance 2019
The Annual G20 Scorecard – Research Performance 2019
bhavesh lande
information control and Security system
information control and Security system
bhavesh lande
information technology and infrastructures choices
information technology and infrastructures choices
bhavesh lande
ethical issues,social issues
ethical issues,social issues
bhavesh lande
managing inforamation system
managing inforamation system
bhavesh lande
• E-commerce, e-business ,e-governance
• E-commerce, e-business ,e-governance
bhavesh lande
IT and innovations
IT and innovations
bhavesh lande
organisations and information systems
organisations and information systems
bhavesh lande
More Related Content
More from bhavesh lande
IT stratergy and digital goods
IT stratergy and digital goods
bhavesh lande
Implement Mapreduce with suitable example using MongoDB.
Implement Mapreduce with suitable example using MongoDB.
bhavesh lande
aggregation and indexing with suitable example using MongoDB.
aggregation and indexing with suitable example using MongoDB.
bhavesh lande
Unnamed PL/SQL code block: Use of Control structure and Exception handling i...
Unnamed PL/SQL code block: Use of Control structure and Exception handling i...
bhavesh lande
database application using SQL DML statements: all types of Join, Sub-Query ...
database application using SQL DML statements: all types of Join, Sub-Query ...
bhavesh lande
database application using SQL DML statements: Insert, Select, Update, Delet...
database application using SQL DML statements: Insert, Select, Update, Delet...
bhavesh lande
Design and Develop SQL DDL statements which demonstrate the use of SQL objec...
Design and Develop SQL DDL statements which demonstrate the use of SQL objec...
bhavesh lande
working with python
working with python
bhavesh lande
applications and advantages of python
applications and advantages of python
bhavesh lande
introduction of python in data science
introduction of python in data science
bhavesh lande
tools
tools
bhavesh lande
data scientists and their role
data scientists and their role
bhavesh lande
applications
applications
bhavesh lande
statistics techniques to deal with data
statistics techniques to deal with data
bhavesh lande
introduction to data science
introduction to data science
bhavesh lande
More from bhavesh lande
(15)
IT stratergy and digital goods
IT stratergy and digital goods
Implement Mapreduce with suitable example using MongoDB.
Implement Mapreduce with suitable example using MongoDB.
aggregation and indexing with suitable example using MongoDB.
aggregation and indexing with suitable example using MongoDB.
Unnamed PL/SQL code block: Use of Control structure and Exception handling i...
Unnamed PL/SQL code block: Use of Control structure and Exception handling i...
database application using SQL DML statements: all types of Join, Sub-Query ...
database application using SQL DML statements: all types of Join, Sub-Query ...
database application using SQL DML statements: Insert, Select, Update, Delet...
database application using SQL DML statements: Insert, Select, Update, Delet...
Design and Develop SQL DDL statements which demonstrate the use of SQL objec...
Design and Develop SQL DDL statements which demonstrate the use of SQL objec...
working with python
working with python
applications and advantages of python
applications and advantages of python
introduction of python in data science
introduction of python in data science
tools
tools
data scientists and their role
data scientists and their role
applications
applications
statistics techniques to deal with data
statistics techniques to deal with data
introduction to data science
introduction to data science
Design and Implement any 5 query using MongoDB
1.
Practical No: 13 Problem
Statement: Design and Implement any 5 query using MongoDB > use prac13 switched to db prac13 > db.stud.insert({roll:1,name:"Alquama"}); WriteResult({ "nInserted" : 1 }) > db.stud.insert({roll:22,name:"Shivesh"}); WriteResult({ "nInserted" : 1 }) > db.stud.insert({roll:32,name:"Sahil"}); WriteResult({ "nInserted" : 1 }) > db.stud.insert({roll:33,name:"Swapnil"}); WriteResult({ "nInserted" : 1 }) > db.stud.insert({roll:20,name:"Swap"}); WriteResult({ "nInserted" : 1 }) > db.stud.find().pretty(); { "_id" : ObjectId("5d988ad7ad81806e4cedd8ce"), "roll" : 1, "name" : "Alquama" } { "_id" : ObjectId("5d988ae8ad81806e4cedd8cf"), "roll" : 22, "name" : "Shivesh" } { "_id" : ObjectId("5d988af5ad81806e4cedd8d0"), "roll" : 32, "name" : "Sahil" } { "_id" : ObjectId("5d988b09ad81806e4cedd8d1"), "roll" : 33, "name" : "Swapnil" } { "_id" : ObjectId("5d988b7ead81806e4cedd8d2"), "roll" : 20, "name" : "Swap" } db.stud.find({roll:22}); { "_id" : ObjectId("5d988ae8ad81806e4cedd8cf"), "roll" : 22, "name" : "Shivesh" } ## sort **descending > db.stud.find({},{"roll":1,_id:0}).sort({"roll":-1}) { "roll" : 33 } { "roll" : 32 } { "roll" : 22 } { "roll" : 20 } { "roll" : 1 } **ascending db.stud.find({},{"roll":1,_id:0}).sort({"roll":1}) { "roll" : 1 } { "roll" : 20 } { "roll" : 22 } { "roll" : 32 } { "roll" : 33 }
2.
##Limit > db.stud.find({},{"roll":1,"name":1,_id:0}).limit(2) { "roll"
: 1, "name" : "Alquama" } { "roll" : 22, "name" : "Shivesh" } ##skip db.stud.find({},{"roll":1,"name":1,_id:0}).limit(1).skip(1); { "roll" : 22, "name" : "Shivesh" } > db.stud.find({},{"roll":1,"name":1,_id:0}).skip(2); { "roll" : 32, "name" : "Sahil" } { "roll" : 33, "name" : "Swapnil" } { "roll" : 20, "name" : "Swap" }
Download Now