- 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
Smita Kapse has Published 560 Articles
Smita Kapse
164 Views
Decision making structures require that the programmer specify one or more conditions to be evaluated or tested by the program, along with a statement or statements to be executed if the condition is determined to be true, and optionally, other statements to be executed if the condition is determined to ... Read More
Smita Kapse
1K+ Views
You can use $set operator for this. The syntax is as follows −db.yourCollectionName.update({}, { $set : {"yourFieldName": [] }} , {multi:true} );To understand the above syntax, let us create a collection with the document. The query to create a collection with a document is as follows −> db.deleteAllElementsInArrayDemo.insertOne({"InstructorName":"Larry", "InstructorTechnicalSubject":["Java", "MongoDB"]}); ... Read More
Smita Kapse
172 Views
To sort in ascending order, the syntax is as follows −db.yourCollectionName.find().sort({yourField:1});To understand the concept, let us create a collection with the document. The query to create a collection with a document is as follows −> db.sortingDemo.insertOne({"Value":100}); { "acknowledged" : true, "insertedId" : ObjectId("5c8f8e2ed3c9d04998abf006") } > db.sortingDemo.insertOne({"Value":1}); { ... Read More
Smita Kapse
1K+ Views
The syntax is as follows for this −db.yourCollectionName.update({ }, { $set: { "yourOuterFieldName.yourInnerFieldName": "yourValue" } });To understand the syntax, let us create a collection with the document. The query to create a collection with a document is as follows −> db.updateNestedValueDemo.insertOne({"CustomerName":"Chris", ... "CustomerDetails":{"CustomerAge":25, "CustomerCompanyName":"Google", "CustomerCityName":"US"}}); { "acknowledged" : ... Read More
Smita Kapse
332 Views
The averagingDouble() method of the Collectors class in Java 8 returns a Collector that is the arithmetic mean of a double-valued function applied to the input elements.The syntax is as follows −public static Collector averagingDouble(ToDoubleFunction
Smita Kapse
140 Views
In this Program we will basically find a feedback arc set which contains edges which when removed from the graph, graph becomes directed acyclic graph.AlgorithmBegin function checkCG(int n) : n: number of vertices. arr: struct graph variable. Initialize cnt = 0 and size = (n-1). For i =0 to n-1 ... Read More
Smita Kapse
291 Views
This example demonstrate How to use hash set 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. ... Read More
Smita Kapse
142 Views
The add() method of the StringJoiner class is used in Java 8 to add a copy of the given CharSequence value as the next element of the StringJoiner value. If the new element ele is null, then the value null gets added.The syntax is as follows −public StringJoiner add(CharSequence ele)Here, ... Read More
Smita Kapse
2K+ Views
In MongoDB, the command does not exist to copy a collection from one database to another. To achieve it, use the below concept −db.yourCollectionName.find().forEach(function(yourVariableName){ db.getSiblingDB('yourDestinationDatabase')['yourCollectionName'].insert(yourVariableName); });Let us create a collection in the test database and copy this collection to another database with the name „sample‟.To understand the above syntax, ... Read More
Smita Kapse
716 Views
Weakly or Strongly Connected for a given a undirected graph can be found out using DFS. This is a C++ program of this problem.Functions usedBegin Function fillorder() = fill stack with all the vertices. a) Mark the current node as visited and print it b) Recur for all ... Read More
To Continue Learning Please Login
Login with Google