
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
AmitDiwan has Published 10744 Articles

AmitDiwan
105 Views
For this, simply use dot notation with find() in MongoDB. Let us create a collection with documents −> db.demo465.insertOne( ... { ... id: 101, ... details: [{ ... Name: "Chris", ... Info: { ... Subject: "MongoDB", ... ... Read More

AmitDiwan
366 Views
To exclude array type field value, use delete() in MongoDB. Let us create a collection with documents −> db.demo464.insertOne( ... { ... ... "id" : "101", ... "details": [ ... { ... Name:"Chris" ... }, ... ... Read More

AmitDiwan
659 Views
To return a single document from a collection, use findOne() in MongoDB. Let us create a collection with documents −> db.demo463.insertOne({"StudentName":"Chris Brown", "StudentAge":21, "StudentCountryName":"US"});{ "acknowledged" : true, "insertedId" : ObjectId("5e7f7ec8cb66ccba22cc9dcf") } > db.demo463.insertOne({"StudentName":"David Miller", "StudentAge":23, "StudentCountryName":"UK"});{ "acknowledged" : true, "insertedId" : ObjectId("5e7f7ed5cb66ccba22cc9dd0") } > db.demo463.insertOne({"StudentName":"John Doe", ... Read More

AmitDiwan
119 Views
The JavaScript Symbol.toStringTag symbol is a very well known symbol that is a string valued property used for giving a description of an object during its creationFollowing is the code for Symbol.toStringTag symbol −Example Live Demo Document body { font-family: "Segoe UI", ... Read More

AmitDiwan
290 Views
To update a specific document in array with $set and positional $ operator, use MongoDB updateOne(). The updateOne() updates a single document in a collection based on a query filter.Let us create a collection with documents −> db.demo462.insertOne( ... { ... "id":1, ... "DueDateDetails": [ ... ... Read More

AmitDiwan
254 Views
To update tag in MongoDB, use the update command. Let us create a collection with documents −> db.demo713.insertOne( ... { ... tags: ... [ ... { ... id:101, ... Name:"Tag-1" ... }, ... ... Read More

AmitDiwan
583 Views
Image sprite is used to reduce the number of http requests that makes our site’s load time faster.Following is the code for creating a navigation menu using CSS image sprite −Example Live Demo body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; margin: 0px; } span ... Read More

AmitDiwan
640 Views
To cast to ObjectId correctly, use aggregate() in MongoDB. Let us create a collection with documents −> db.demo460.insertOne({"_id":"5ab9cbfa31c2ab715d42129e"}); { "acknowledged" : true, "insertedId" : "5ab9cbfa31c2ab715d42129e" }Display all documents from a collection with the help of find() method −> db.demo460.find();This will produce the following output −{ "_id" : "5ab9cbfa31c2ab715d42129e" }Following is ... Read More

AmitDiwan
917 Views
To get items from an object array, use aggregate(). Let us create a collection with documents −> db.demo459.insertOne( ... { "_id" : 1, ... "Information" : [ ... { ... "Name" : "Chris", ... "_id" : new ObjectId(), ... "details" ... Read More

AmitDiwan
380 Views
To update a record, you need to update on the basis of _id. Let us create a collection with documents −> db.demo458.insertOne( {_id:101, "Name":"David" } ); { "acknowledged" : true, "insertedId" : 101 } > db.demo458.insertOne( {_id:102, "Name":"Chris" } ); { "acknowledged" : true, "insertedId" : 102 } > db.demo458.insertOne( ... Read More