- 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
Anvi Jain has Published 629 Articles
![Anvi Jain](https://www.tutorialspoint.com/assets/profiles/13591/profile/60_98631-1512716973.jpg)
Anvi Jain
167 Views
If a collection does not exist then MongoDB creates a collection in indexing part. The createdCollectionAutomatically tells that the operation created a collection.For our example, let us create a collection with an index −> db.createCollectionDemo.createIndex({"ClientCountryName":1});This will produce the following output −{ "createdCollectionAutomatically" : true, "numIndexesBefore" : 1, ... Read More
![Anvi Jain](https://www.tutorialspoint.com/assets/profiles/13591/profile/60_98631-1512716973.jpg)
Anvi Jain
205 Views
Let’s say the following is our JTextPane −JTextPane textPane = new JTextPane(); textPane.setForeground(Color.white); textPane.setBackground(Color.blue);Now, set the style and attributes. Also, set the font −SimpleAttributeSet attributeSet = new SimpleAttributeSet(); StyleConstants.setItalic(attributeSet, true); textPane.setCharacterAttributes(attributeSet, true); textPane.setText("Press the Button "); Font font = new Font("Verdana", Font.BOLD, 22); textPane.setFont(font);After the text displayed above, we will ... Read More
![Anvi Jain](https://www.tutorialspoint.com/assets/profiles/13591/profile/60_98631-1512716973.jpg)
Anvi Jain
182 Views
In this section we will see the nullptr in C++. The nullptr denotes the pointer literals. It is a prvalue of type std::nullptr_t. It has implicit conversion property from nullptr to null pointer value of any pointer type and any pointer to member type. Let us see one program, to ... Read More
![Anvi Jain](https://www.tutorialspoint.com/assets/profiles/13591/profile/60_98631-1512716973.jpg)
Anvi Jain
1K+ Views
To get the path of the selected file, at first get the selected file −java.io.File f = file.getSelectedFile();Now, get the path of the selected file which we will get using the above method −System.err.println(f.getPath());The following is an example to get the path of the file selected in the JFileChooser component ... Read More
![Anvi Jain](https://www.tutorialspoint.com/assets/profiles/13591/profile/60_98631-1512716973.jpg)
Anvi Jain
685 Views
If we need to modify a pointer rather than the object that the pointer is pointing to, we pass a pointer by reference.Here is an example of how to pass a pointer by reference −Example Live Demo#include using namespace std; void Decrement( int*& d ) { --d; } int ... Read More
![Anvi Jain](https://www.tutorialspoint.com/assets/profiles/13591/profile/60_98631-1512716973.jpg)
Anvi Jain
243 Views
You can use $where operator for this. Let us first create a collection with documents −>db.searchDocumentArrayIntegerDemo.insertOne({"StudentFirstName":"John", "StudentScores":[45, 78, 89, 90]}); { "acknowledged" : true, "insertedId" : ObjectId("5cd2a219345990cee87fd88c") } >db.searchDocumentArrayIntegerDemo.insertOne({"StudentFirstName":"Larry", "StudentScores":[45, 43, 34, 33]}); { "acknowledged" : true, "insertedId" : ObjectId("5cd2a22a345990cee87fd88d") } >db.searchDocumentArrayIntegerDemo.insertOne({"StudentFirstName":"Chris", "StudentScores":[]}); { "acknowledged" ... Read More
![Anvi Jain](https://www.tutorialspoint.com/assets/profiles/13591/profile/60_98631-1512716973.jpg)
Anvi Jain
36 Views
We can set or disallow selection of column in the table using setColumnSelectionAllowed().Let’s say the following is our table −DefaultTableModel tableModel = new DefaultTableModel(); JTable table = new JTable(tableModel);If you want to allow selection of column, then set the method to TRUE −table.setColumnSelectionAllowed(true);If you want to disallow selection of column, ... Read More
![Anvi Jain](https://www.tutorialspoint.com/assets/profiles/13591/profile/60_98631-1512716973.jpg)
Anvi Jain
3K+ Views
Travelling Salesman Problem use to calculate the shortest route to cover all the cities and return back to the origin city. This method is use to find the shortest path to cover all the nodes of a graph.This is the program to find shortest route of a unweighted graph.AlgorithmBegin ... Read More
![Anvi Jain](https://www.tutorialspoint.com/assets/profiles/13591/profile/60_98631-1512716973.jpg)
Anvi Jain
4K+ Views
To compile multiple files like file_name.h, or file_name.cpp at once, we can use the files like a list one after another. The syntax will be like this −g++ abc.h xyz.cppTo run the program, we can use this −./a.outExamplefloat area(float r){ return (3.1415*r*r); //area of a circle } float area(float ... Read More
![Anvi Jain](https://www.tutorialspoint.com/assets/profiles/13591/profile/60_98631-1512716973.jpg)
Anvi Jain
499 Views
We will use the Null type here. Following are the null types with the alias −TypeNumberAliasDouble1“double”String2“string”Object3“object”Array4“array”Binary data5“binData”Undefined6“undefined”ObjectId7“objectId”Boolean8“bool”Date9“date”Null10“null”Regular Expression11“regex”Following is the syntax for type 10 i.e. null −db.yourCollectionName.find({"yourFieldName":{ $type: 10 } });The above syntax will find only those documents which have null value. Let us first create a collection with documents ... Read More