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
Nishtha Thakur has Published 495 Articles
Nishtha Thakur
455 Views
Let us first create a collection with documents −> db.updateArrayElementDemo.insertOne( { "UserDetails": [ { "UserName":"Chris", "UserAge":23 } ] } ... Read More
Nishtha Thakur
639 Views
To update boolean value, you can use SET. Let us first create a table −mysql> create table DemoTable ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, isMarried boolean ); Query OK, 0 rows affected (0.58 sec)Insert some records in the table using insert command −mysql> insert into ... Read More
Nishtha Thakur
1K+ Views
To request location Permission we will be using Apple’s CLLocationManager class. You use instances of this class to configure, start, and stop the Core Location services.You can read more about CLLocationManager class here. https://developer.apple.com/documentation/corelocation/cllocationmanageriOS apps can support one of two levels of location access.While using the app − The app can ... Read More
Nishtha Thakur
174 Views
You can use find() for this. Let us first create a collection with documents −> db.findDocumentsDemo.insertOne( { _id: 101, "ProductDetails": [ { "ProductValue":100 }, { "ProductValue":120 } ] } ); { ... Read More
Nishtha Thakur
307 Views
For performing mathematical operations and working with conditions, you can consider CASE statement. Let us first create a table −mysql> create table DemoTable ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, FruitName varchar(100), FruitPrice int ); Query OK, 0 rows affected (0.26 sec)Insert some records ... Read More
Nishtha Thakur
1K+ Views
To convert a field to an array, use $set operator. Let us first create a collection with documents −> db.convertAFieldToAnArrayDemo.insertOne({"StudentSubject":"MongoDB"}); { "acknowledged" : true, "insertedId" : ObjectId("5ce92d7778f00858fb12e91d") }Following is the query to display all documents from a collection with the help of find() method −> db.convertAFieldToAnArrayDemo.find();This will produce ... Read More
Nishtha Thakur
2K+ Views
You need to follow some steps to add a new column after a specific column and defining default value. In order to achieve this, you need to use ALTER command. Let us first create a table −mysql> create table DemoTable ( StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY, ... Read More
Nishtha Thakur
218 Views
To update a single list item, use positional operator($). Let us first create a collection with documents −> db.updateASingleListDemo.insertOne({ _id:1, "EmployeeName":"Chris", "EmployeeDetails": [ {"EmployeeId":"EMP-101", "EmployeeSalary": 18999 }] }); { "acknowledged" : true, "insertedId" : 1 }Following is the query to display all documents from a collection with the help of ... Read More
Nishtha Thakur
214 Views
For this, you can use $elemMatch operator. The $elemMatch operator matches documents that contain an array field with at least one element that matches all the specified query criteria. Let us first create a collection with documents −> db.filterBySeveralElementsDemo.insertOne( "_id":100, "StudentDetails": [ { ... Read More
Nishtha Thakur
220 Views
You can use DEFAULT CURRENT_TIMESTAMP. Keep in mind that it will work only at the time of insertion. Let us first create a table −mysql> create table DemoTable ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, Arrivaltime TIMESTAMP DEFAULT CURRENT_TIMESTAMP ); Query OK, 0 rows affected ... Read More