
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
4K+ Views
To match date, use $match along with aggregate(). Let us create a collection with documents −> db.demo491.insertOne({"ShippingDate":new ISODate("2020-01-10")});{ "acknowledged" : true, "insertedId" : ObjectId("5e849a09b0f3fa88e22790be") } > db.demo491.insertOne({"ShippingDate":new ISODate("2020-02-21")});{ "acknowledged" : true, "insertedId" : ObjectId("5e849a0eb0f3fa88e22790bf") } > db.demo491.insertOne({"ShippingDate":new ISODate("2020-03-23")});{ "acknowledged" : true, "insertedId" : ObjectId("5e849a1db0f3fa88e22790c0") ... Read More

AmitDiwan
158 Views
For all elements of a field in MongoDB, use find() and in that, use $elemMatch. The $elemMatch operator matches documents that contain an array field with at least one element that matches all the specified query criteria.Let us create a collection with documents −> db.demo624.insertOne({"ListOfName":["John", "Chris", "David", "Bob"]}); { ... Read More

AmitDiwan
507 Views
Yes, to search an array of objects, use $unwind in MongoDB aggregate(). To match, use $match. Let us create a collection with documents −> db.demo623.insertOne( ... { ... _id:1, ... details:[ ... { ... ... Read More

AmitDiwan
504 Views
To fix this, use $dateFromString in MongoDB aggregate(). The $dateFromString converts a date/time string to a date object.Let us create a collection with documents −> db.demo619.insertOne({"DueDate":"10-10-2020"}); { "acknowledged" : true, "insertedId" : ObjectId("5e99d7846c954c74be91e69e") } > db.demo619.insertOne({"DueDate":"12-01-2019"}); { "acknowledged" : true, "insertedId" : ObjectId("5e99d7996c954c74be91e69f") } > db.demo619.insertOne({"DueDate":"28-10-2010"}); ... Read More

AmitDiwan
286 Views
Remove document using remove(), whose value is matched with $eq from a MongoDB collection. The $eq operator matches documents where the value of a field equals the specified value.Let us create a collection with documents −> db.demo626.insertOne({id:1, "Name":"Chris"}); { "acknowledged" : true, "insertedId" : ObjectId("5e9ac6376c954c74be91e6ae") } > db.demo626.insertOne({id:2, ... Read More

AmitDiwan
2K+ Views
To redirect to another webpage using JavaScript, the code is as follows −Example Live Demo Redirect to a Webpage Example Redirect Click the above button to Redirect to another Webpage document .querySelector(".redirectBtn") .addEventListener("click", redirectFunction); function redirectFunction() { location.href("https://tutorialspoint.com/"); } OutputThe ... Read More

AmitDiwan
329 Views
To create a speed converter with HTML and JavaScript, the code is as follows −Example Live Demo body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } input, span { font-size: 20px; } Speed Converter ... Read More

AmitDiwan
1K+ Views
To create a length converter with HTML and JavaScript, the code is as follows −Example Live Demo body{ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; } input, span{ font-size: 20px; } Length Converter Type length ... Read More

AmitDiwan
759 Views
To create a temperature converter with HTML and JavaScript, the code is as follows −Example Live Demo body{ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; } input, span{ font-size: 20px; } Temperature Converter Type Temperature ... Read More

AmitDiwan
377 Views
To create a weight converter with HTML and JavaScript, the code is as follows −Example Live Demo body{ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; } input, span{ font-size: 20px; } Weight Converter Type weight ... Read More