- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 1659 Articles for Big Data Analytics
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
743 Views
To get the mean daily average count of recorded documents, use aggregate(). Within that, use $project and $group.Let us create a collection with documents −Example> db.demo451.insertOne({ ... DueDate:new ISODate("2020-03-15T10:50:35.000Z"), ... Value: 10 ... } ... ); { "acknowledged" : true, "insertedId" : ObjectId("5e7b5c5d71f552a0ebb0a6e9") } > db.demo451.insertOne({ ... DueDate:new ISODate("2020-03-14T10:50:35.000Z"), ... Value: 10 ... } ... ); { "acknowledged" : true, "insertedId" : ObjectId("5e7b5c5d71f552a0ebb0a6ea") } > db.demo451.insertOne({ ... DueDate:new ISODate("2020-03-13T10:50:35.000Z"), ... Value: 10 ... } ... ); { "acknowledged" : true, "insertedId" : ObjectId("5e7b5c5d71f552a0ebb0a6eb") }Display all documents from a collection with the help of find() ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
115 Views
In order to reach subdata, you need to use key in MongoDB. Let us create a collection with documents −>db.demo450.insertOne({"Information":{"StudentDetails":{"StudentName":"Chris", "StudentAge":21}}}); { "acknowledged" : true, "insertedId" : ObjectId("5e7b590e71f552a0ebb0a6e6") } >db.demo450.insertOne({"Information":{"StudentDetails":{"StudentName":"David", "StudentAge":23}}});{ "acknowledged" : true, "insertedId" : ObjectId("5e7b591a71f552a0ebb0a6e7") } >db.demo450.insertOne({"Information":{"StudentDetails":{"StudentName":"Mike", "StudentAge":22}}});{ "acknowledged" : true, "insertedId" : ObjectId("5e7b592271f552a0ebb0a6e8") }Display all documents from a collection with the help of find() method −> db.demo450.find();This will produce the following output −{ "_id" : ObjectId("5e7b590e71f552a0ebb0a6e6"), "Information" : { "StudentDetails" : { "StudentName" : "Chris", "StudentAge" : 21 } } } { "_id" : ObjectId("5e7b591a71f552a0ebb0a6e7"), "Information" : { "StudentDetails" : { ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
762 Views
To insert an item to an already created array inside an object, use MongoDB $push. Let us create a collection with documents −> db.demo449.insertOne( ... { ... details1: { ... details2: [{ ... _id:new ObjectId(), ... Name:"Chris" ... }], ... details3: [{ ... _id:new ObjectId(), ... Name:"David" ... }] ... } ... } ... ); { "acknowledged" : true, "insertedId" : ObjectId("5e7a40e971f552a0ebb0a6e3") }Display all documents from ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
2K+ Views
The findOneAndDelete() deletes single documents from the collection on the basis of a filter and sort criteria as well as it returns the deleted document.The deleteOne() removes single document from the collection.Let us see an example and create a collection with documents −> db.demo448.insertOne({"Name":"Chris", "Age":21});{ "acknowledged" : true, "insertedId" : ObjectId("5e7a291cbbc41e36cc3caeca") } > db.demo448.insertOne({"Name":"David", "Age":23});{ "acknowledged" : true, "insertedId" : ObjectId("5e7a2926bbc41e36cc3caecb") } > db.demo448.insertOne({"Name":"Bob", "Age":22});{ "acknowledged" : true, "insertedId" : ObjectId("5e7a2930bbc41e36cc3caecc") }Display all documents from a collection with the help of find() method −> db.demo448.find();This will produce the following output −{ "_id" : ObjectId("5e7a291cbbc41e36cc3caeca"), ... Read More
![Kiran Kumar Panigrahi](https://www.tutorialspoint.com/assets/profiles/390736/profile/60_2598-1635242143.png)
633 Views
Data scientists, data engineers, and data analysts are all professionals who work with data in some way. However, they have different roles and responsibilities. Read this article to find out more the job profiles of data scientists, data engineers, and data analysts and how you can distinguish among them. Who is a Data Scientist? A Data Scientist is one who analyses and interprets complex data in digital form. Data scientists are responsible for extracting insights and knowledge from data. They use a variety of techniques, including machine learning, to analyze data and communicate their findings to stakeholders. There are several ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
434 Views
For this, you can use $lookup. Let us create a collection with documents −> db.demo446.insert([ ... { "ProductName": "Product1", "ProductPrice": 60 }, ... { "ProductName": "Product2", "ProductPrice": 90 } ... ]) BulkWriteResult({ "writeErrors" : [ ], "writeConcernErrors" : [ ], "nInserted" : 2, "nUpserted" : 0, "nMatched" : 0, "nModified" : 0, "nRemoved" : 0, "upserted" : [ ] })Display all documents from a collection with the help of find() method −> db.demo446.find();This will produce the following output −{ "_id" : ObjectId("5e790766bbc41e36cc3caec3"), "ProductName" : "Product1", "ProductPrice" : 60 } { ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
119 Views
To push into an array with MongoDB, use $push. Let us create a collection with documents −> db.demo445.insertOne({"ListOfFriends":["Robert", "Mike", "Sam", "Carol", "David", "Mike"]}); { "acknowledged" : true, "insertedId" : ObjectId("5e78f099bbc41e36cc3caec2") }Display all documents from a collection with the help of find() method −> db.demo445.find().pretty();This will produce the following output −{ "_id" : ObjectId("5e78f099bbc41e36cc3caec2"), "ListOfFriends" : [ "Robert", "Mike", "Sam", "Carol", "David", "Mike" ] }Following is the query to push into an array −> db.demo445.update( ... { ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
124 Views
For this, use $elemMatch, which is used to query nested objects. Let us create a collection with documents −> db.demo444.insertOne( ... { ... "Information": [{ ... id:1, ... Name:"Chris" ... }] ... } ... ); { "acknowledged" : true, "insertedId" : ObjectId("5e78ea87bbc41e36cc3caebf") } > db.demo444.insertOne( ... { ... "Information": [{ ... id:2, ... Name:"David" ... }] ... } ... ); { "acknowledged" : true, ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
172 Views
The following operations are treated as command operation in MongoDB −1.count 2.findAndModify 3.aggregateFollowing is the example of count in MongoDB −Let us create a collection with documents −> db.demo443.insertOne({"Name":"Chris"}); { "acknowledged" : true, "insertedId" : ObjectId("5e78d281bbc41e36cc3caeb9") } > db.demo443.insertOne({"Name":"Bob"}); { "acknowledged" : true, "insertedId" : ObjectId("5e78d285bbc41e36cc3caeba") } > db.demo443.insertOne({"Name":"David"}); { "acknowledged" : true, "insertedId" : ObjectId("5e78d288bbc41e36cc3caebb") }Display all documents from a collection with the help of find() method −> db.demo443.find();This will produce the following output −{ "_id" : ObjectId("5e78d281bbc41e36cc3caeb9"), "Name" : "Chris" } { "_id" : ObjectId("5e78d285bbc41e36cc3caeba"), "Name" : "Bob" } { "_id" : ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
1K+ Views
To get distinct values from object array in MongoDB, use distinct(). Let us create a collection with documents −> db.demo442.insertOne( ... { ... ... "Information" : [ ... { ... "FirstName" : "John", ... "Age" : 21 ... }, ... { ... "FirstName" : "Sam", ... "Age" : 23 ... }, ... ... Read More