- 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
179 Views
Let us first create a collection with documents −> db.projectionAnElementDemo.insertOne( ... { ... "CustomerId":100, ... "CustomerDetails": [ ... { ... "CustomerName": "Chris", ... "CustomerCountryName": "US" ... ... Read More
Nishtha Thakur
328 Views
You need to use multi:true to update multiple documents. Let us first create a collection with documents −> db.multiUpdateDemo.insertOne({"ClientName":"John", "ClientAge":29}); { "acknowledged" : true, "insertedId" : ObjectId("5cda5bc0b50a6c6dd317adc8") } > db.multiUpdateDemo.insertOne({"ClientName":"Carol", "ClientAge":31}); { "acknowledged" : true, "insertedId" : ObjectId("5cda5bc1b50a6c6dd317adc9") } > db.multiUpdateDemo.insertOne({"ClientName":"John", "ClientAge":39}); { "acknowledged" : ... Read More
Nishtha Thakur
118 Views
In the cstdlib library of C++, there are different functions for getting the absolute value except from abs. The abs are used basically for int type input in C, and int, long, long long in C++. The others are used for long, and long long type data etc. Let us ... Read More
Nishtha Thakur
1K+ Views
Here we will see how to prevent inheritance in C++. The concept of preventing the inheritance is known as final class.In Java or C#, we can use final classes. In C++ there are no such direct way. Here we will see how to simulate the final class in C++.Here we ... Read More
Nishtha Thakur
941 Views
To highlight a row in a table, you can use the addRowSelectionInterval() method. At first create a table −DefaultTableModel tableModel = new DefaultTableModel(); JTable table = new JTable(tableModel);Add some columns −tableModel.addColumn("Language/ Technology"); tableModel.addColumn("Text Tutorial"); tableModel.addColumn("Video Tutorial"); tableModel.addColumn("Views");Now, add rows to the table −tableModel.addRow(new Object[] { "NodeJS", "No", "Yes", "2350"}); tableModel.addRow(new ... Read More
Nishtha Thakur
183 Views
If you will try to use the method drop(), then it will delete all information about the collection. Indexing is fast. However, if you will use the method remove(), then it removes all records but keeps the collection and indexes.Let us check with the help of example.Using drop()Let us first ... Read More
Nishtha Thakur
595 Views
We use gcc and g++ compilers in different times. Here we will see what are the differences between gcc and g++.The gcc is GNU C compiler, and g++ is GNU C++ compiler. The main differences are like below −gcc can compile *.c or *.cpp files as C and C++ respectivelyg++ ... Read More
Nishtha Thakur
408 Views
You can use $match operator under aggregate() to get the first record. Let us first create a collection with documents −> db.conditionalFirstDemo.insertOne({_id:100, "StudentName":"Chris", "StudentSubject":null}); { "acknowledged" : true, "insertedId" : 100 } > db.conditionalFirstDemo.insertOne({_id:101, "StudentName":"Chris", "StudentSubject":null}); { "acknowledged" : true, "insertedId" : 101 } >db.conditionalFirstDemo.insertOne({_id:102, "StudentName":"Chris", "StudentSubject":"MongoDB"}); { "acknowledged" : ... Read More
Nishtha Thakur
9K+ Views
A Json array is an ordered collection of values that are enclosed in square brackets i.e. it begins with ‘[’ and ends with ‘]’. The values in the arrays are separated by ‘, ’ (comma).Sample JSON array{ "books": [ Java, JavaFX, Hbase, Cassandra, WebGL, JOGL] }The json-simple is a ... Read More
Nishtha Thakur
463 Views
In this section, we will see how to find the middle of three given values by comparing them. So if three numbers are given like (10, 30, 20), then it will find 20 as this is the middle element. Let us see the algorithm first, then we will implement that ... Read More