Anvi Jain has Published 629 Articles

How to delete a table from MongoDB database?

Anvi Jain

Anvi Jain

Updated on 30-Jul-2019 22:30:26

380 Views

Use drop() to delete a table. Following is the syntax −db.yourCollectionName.drop();Let us first create a collection with documents −> db.deleteTableDemo.insertOne({"Name":"Chris", "Age":23}); {    "acknowledged" : true,    "insertedId" : ObjectId("5ccfb705140b992277dae0e6") } > db.deleteTableDemo.insertOne({"Name":"Carol", "Age":21}); {    "acknowledged" : true,    "insertedId" : ObjectId("5ccfb70c140b992277dae0e7") } > db.deleteTableDemo.insertOne({"Name":"David", "Age":24}); {    "acknowledged" ... Read More

The best way to hide a string in binary code in C++?

Anvi Jain

Anvi Jain

Updated on 30-Jul-2019 22:30:26

490 Views

Here we will see how to hide some string into some binary code (Here binary code is represented in hexadecimal number).The approach is very simple. We can use the string stream to convert decimal number to hexadecimal numbers. Now from the string, we will read each character, and take its ... Read More

Querying null value in MongoDB?

Anvi Jain

Anvi Jain

Updated on 30-Jul-2019 22:30:26

284 Views

To query null value in MongoDB, use $ne operator. Let us first create a collection with documents −> db.queryingNullDemo.insertOne( ...    { ...       "StudentName":"Larry", ...       "StudentDetails": ...       { ...          "StudentAge":21, ...          "StudentSubject":"MongoDB" ... ... Read More

What is the most effective way for float and double comparison in C/C++?

Anvi Jain

Anvi Jain

Updated on 30-Jul-2019 22:30:26

6K+ Views

Here we will see how to compare two floating point data or two double data using C or C++. The floating point / double comparison is not similar to the integer comparison.To compare two floating point or double values, we have to consider the precision in to the comparison. For ... Read More

Use ObjectId under findOne() to fetch a specific record in MongoDB?

Anvi Jain

Anvi Jain

Updated on 30-Jul-2019 22:30:26

380 Views

Let us first create a collection with documents −> db.findOneWorkingDemo.insertOne({"ClientId":1, "ClientName":"Larry", "ClientAge":26}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cd7c1716d78f205348bc64d") } > db.findOneWorkingDemo.insertOne({"ClientId":2, "ClientName":"Chris", "ClientAge":28}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cd7c17d6d78f205348bc64e") } > db.findOneWorkingDemo.insertOne({"ClientId":3, "ClientName":"Robert", "ClientAge":34}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cd7c1896d78f205348bc64f") }Following ... Read More

Query for multiple parameters in MongoDB?

Anvi Jain

Anvi Jain

Updated on 30-Jul-2019 22:30:26

1K+ Views

To query for multiple parameters in MongoDB, you can use the dot(.) notation. Let us first create a collection with documents −> db.multipleParametersDemo.insertOne( ...    { ...       "CustomerName" : "Larry", ...       "CustomerDetails" : [ ...          { ...       ... Read More

How to set the background color of a single tab in a JTabbedPane Container with Java?

Anvi Jain

Anvi Jain

Updated on 30-Jul-2019 22:30:26

840 Views

To set the background color of a single tab, use the setBackgroundAt() method. This gives an option to mention the index and the color. The index here is the index of the specific tab you want to color.Let us first create a JTabbedPane −JTabbedPane tabbedPane = new JTabbedPane();Now, set the ... Read More

What is difference between a pointer and reference parameter in C++?

Anvi Jain

Anvi Jain

Updated on 30-Jul-2019 22:30:26

6K+ Views

PointersPointer variables are used to store the address of variable.SyntaxType *pointer;InitializationType *pointer; Pointer=variable name;ReferencesWhen a parameter is declared as reference, it becomes an alternative name for an existing parameter.SyntaxType &newname=existing name;InitializationType &pointer; Pointer=variable name;The main differences between pointers and reference parameters are −References are used to refer an existing variable ... Read More

Is there a difference between copy initialization and direct initialization in C++?

Anvi Jain

Anvi Jain

Updated on 30-Jul-2019 22:30:26

2K+ Views

The Copy initialization can be done using the concept of copy constructor. As we know that the constructors are used to initialize the objects. We can create our copy constructor to make a copy of some other object, or in other words, initialize current object with the value of another ... Read More

How to create a local Notifications in Android?

Anvi Jain

Anvi Jain

Updated on 30-Jul-2019 22:30:26

253 Views

This example demonstrate about How to create a local Notifications in AndroidStep 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.     Step 3 ... Read More

Advertisements