
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
Smita Kapse has Published 498 Articles

Smita Kapse
365 Views
You can use aggregate framework. Let us first create a collection with documents −> db.getArrayDemo.insertOne( { "CustomerId":101, "CustomerDetails":[ { "CustomerName":"Larry", "CustomerFriendDetails":[ ... Read More

Smita Kapse
206 Views
Here we will see, why we should use the strict aliasing in C. Before discussing that part, let us see one code, and try to analyze the output.Example#include int temp = 5; int* var = &temp; int my_function(double* var) { temp = 1; *var = 5.10; //this will change the value of temp return (temp); } main() { printf("%d", my_function((double*)&temp)); }Output1717986918If we ... Read More

Smita Kapse
208 Views
This example demonstrate about How to make an icon in the action bar with the number of 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 ... Read More

Smita Kapse
496 Views
You can use $set operator for this. Let us first create a collection with documents −> db.updateSubObjectDemo.insertOne( ... { ... ... "ClientId" : 100, ... "ClientDetails" : { ... "ClientFirstName" : "Adam" ... } ... ... Read More

Smita Kapse
302 Views
You can use $set operator for this. Following is the syntax −db.yourCollectionName.update({"_id" : yourObjectId }, {$set: { "yourOuterFieldName.anyInnerFieldName": yourValue}});Let us first create a collection with documents −> db.pushNewKeyDemo.insertOne({"UserId":100, "UserDetails":{}}); { "acknowledged" : true, "insertedId" : ObjectId("5cda58f5b50a6c6dd317adbf") }Following is the query to display all documents from a collection with ... Read More

Smita Kapse
205 Views
Here we will see the functionality of remainder() method of C++. The remainder() function is used to compute the floating point remainder of numerator/denominator.So the remainder(x, y) will be like below.remainder(x, y) = x – rquote * yThe rquote is the value of x/y. This is rounded towards the nearest ... Read More

Smita Kapse
185 Views
Sometimes we may see some numeric literals, which is prefixed with 0. This indicates that the number is octal number. So octal literals contain 0 at the beginning. For example, if an octal number is 25, then we have to write 025.Example#include int main() { int a = ... Read More

Smita Kapse
203 Views
Use FlowLayout.CENTER to lay out components in a flow to be centered with FlowLayout. The following is an example to lay out components in a flow to be centered with FlowLayout −Examplepackage my; import java.awt.Color; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Font; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTextArea; import javax.swing.WindowConstants; public ... Read More

Smita Kapse
321 Views
You can use $where operator for this. Let us first create a collection with documents −> db.sumOfFieldIsGreaterThanDemo.insertOne({"Price1":10, "Price2":50, "Price3":40}); { "acknowledged" : true, "insertedId" : ObjectId("5cdd84b8bf3115999ed511e6") } > db.sumOfFieldIsGreaterThanDemo.insertOne({"Price1":11, "Price2":1, "Price3":120}); { "acknowledged" : true, "insertedId" : ObjectId("5cdd84c6bf3115999ed511e7") } > db.sumOfFieldIsGreaterThanDemo.insertOne({"Price1":10, "Price2":9, "Price3":6}); { "acknowledged" ... Read More

Smita Kapse
2K+ Views
To create a collection correctly you need to use a MongoDB object in call i.e.db.createCollection("yourCollectionName");Let us implement the above syntax in order to create a collection and call it using a MongoDB object −> use sample; switched to db sample > db.createCollection("employeeInformation"); { "ok" : 1 }Display all the ... Read More