- 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
Nishtha Thakur has Published 564 Articles
Nishtha Thakur
689 Views
You can use $pull operator for this. Let us first create a collection with documents. Here, we have also added an empty object −> db.removeEmptyObjectsDemo.insertOne( { "_id" :101, "LoginDate" :new ISODate(), "UserDetails" : [ { ... Read More
Nishtha Thakur
924 Views
You can use group_concat() along with concat() to concatenate all values of a single column. Let us first create a table −mysql> create table DemoTable ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, FirstName varchar(20) ); Query OK, 0 rows affected (0.73 sec)Insert some records ... Read More
Nishtha Thakur
354 Views
Let us first create a collection with documents −> db.updateArrayElementDemo.insertOne( { "UserDetails": [ { "UserName":"Chris", "UserAge":23 } ] } ... Read More
Nishtha Thakur
459 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
92 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
195 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
1K+ 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
135 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