- 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

Updated on 30-Jul-2019 22:30:25
If you want to delete all documents from the collection, you can use deleteMany(). Let us first create a collection and insert some documents to it:> db.deleteDocumentsDemo.insert({"Name":"Larry", "Age":23}); WriteResult({ "nInserted" : 1 }) > db.deleteDocumentsDemo.insert({"Name":"Mike", "Age":21}); WriteResult({ "nInserted" : 1 }) > db.deleteDocumentsDemo.insert({"Name":"Sam", "Age":24}); WriteResult({ "nInserted" : 1 })Now display all the documents from the collection. The query is as follows:> db.deleteDocumentsDemo.find().pretty();The following is the output:{ "_id" : ObjectId("5c6ab0e064f3d70fcc914805"), "Name" : "Larry", "Age" : 23 } { "_id" : ObjectId("5c6ab0ef64f3d70fcc914806"), "Name" : "Mike", "Age" : 21 } { "_id" : ObjectId("5c6ab0f864f3d70fcc914807"), "Name" ... Read More 
Updated on 30-Jul-2019 22:30:25
A JSP expression element contains a scripting language expression that is evaluated, converted to a String, and inserted where the expression appears in the JSP file.Because the value of an expression is converted to a String, you can use an expression within a line of text, whether or not it is tagged with HTML, in a JSP file.The expression element can contain any expression that is valid according to the Java Language Specification but you cannot use a semicolon to end an expression.Following is the syntax of JSP Expression −You can write the XML equivalent of the above syntax as ... Read More 
Updated on 30-Jul-2019 22:30:25
The tag is used to parse numbers, percentages, and currencies.AttributeThe tag has the following attributes −AttributeDescriptionRequiredDefaultValueNumeric value to read (parse)NoBodytypeNUMBER, CURRENCY, or PERCENTNonumberparseLocaleLocale to use when parsing the numberNoDefault localeintegerOnlyWhether to parse to an integer (true) or floating-point number (false)NofalsepatternCustom parsing patternNoNonetimeZoneTime zone of the displayed dateNoDefault time zonevarName of the variable to store the parsed numberNoPrint to pagescopeScope of the variable to store the formatted numberNopageA pattern attribute is provided that works just like the pattern attribute for the tag. However, in the case of parsing, the pattern attribute tells the parser what format to expect.Example ... Read More 
Updated on 30-Jul-2019 22:30:25
An immutable copy of a LocalTime object where some nanoseconds are subtracted from it can be obtained using the minusNanos() method in the LocalTime class in Java. This method requires a single parameter i.e. the number of nanoseconds to be subtracted and it returns the LocalTime object with the subtracted nanoseconds.A program that demonstrates this is given as follows −Example Live Demoimport java.time.*; public class Demo { public static void main(String[] args) { LocalTime lt = LocalTime.now(); System.out.println("The current LocalTime is: " + lt); System.out.println("The LocalTime with 1000 nanoseconds subtracted is: ... Read More 
Updated on 30-Jul-2019 22:30:25
Natural language processing is the study of automated generation and understanding of natural human languages. This is becoming more and more interesting tasks to solve, as computer technology is integrated into almost every industry nowadays. We are going to study one specific field within natural language processing; readability. This involves the topic of determining the readability of a text. This indicates how difficult it is to read or understand a text.A readability index is a numeric value that indicates how difficult (or easy) it is to read and understand a text. There are several different tests for determining readability, and ... Read More 
Updated on 30-Jul-2019 22:30:25
You can use $all operator to find by multiple array items. 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.findByMultipleArrayDemo.insertOne({"StudentFirstName":"John", "StudentLastName":"Smith", "StudentCoreSubject":["Compiler", "Operating System", "Computer Networks"]}); { "acknowledged" : true, "insertedId" : ObjectId("5c7ef07b559dd2396bcfbfc4") } > db.findByMultipleArrayDemo.insertOne({"StudentFirstName":"Carol", "StudentLastName":"Taylor", "StudentCoreSubject":["MongoDB", "MySQL", "SQL Server"]}); { "acknowledged" : true, "insertedId" : ObjectId("5c7ef09d559dd2396bcfbfc5") } > db.findByMultipleArrayDemo.insertOne({"StudentFirstName":"Bob", "StudentLastName":"Taylor", "StudentCoreSubject":["MongoDB", "MySQL", "SQL Server"]}); { "acknowledged" : true, "insertedId" : ObjectId("5c7ef0c7559dd2396bcfbfc6") } > db.findByMultipleArrayDemo.insertOne({"StudentFirstName":"David", "StudentLastName":"Johnson", "StudentCoreSubject":["Compiler", "Operating System", "Computer Networks"]}); { ... Read More 
Updated on 30-Jul-2019 22:30:25
You can use COUNT() function for this. Let us first create a demo tablemysql> create table countValueDemo -> ( -> ShippingDatetime datetime, -> FirstValue int, -> SecondValue int -> ); Query OK, 0 rows affected (1.35 sec)Insert some records in the table using insert command. The query is as follows −mysql> insert into countValueDemo values('2019-01-23', 1, 2); Query OK, 1 row affected (0.24 sec) mysql> insert into countValueDemo values('2017-02-21', NULL, 2); Query OK, 1 row affected (0.13 sec) mysql> insert into countValueDemo values('2016-04-12', 1, NULL); ... Read More 
Updated on 30-Jul-2019 22:30:25
This is a C++ program to read a text file.Inputtpoint.txt is having initial content as “Tutorials point.”OutputTutorials point.AlgorithmBegin Create an object newfile against the class fstream. Call open() method to open a file “tpoint.txt” to perform write operation using object newfile. If file is open then Input a string “Tutorials point" in the tpoint.txt file. Close the file object newfile using close() method. Call open() method to open a file “tpoint.txt” to perform read operation using object newfile. If file is open then Declare a string ... Read More 
Updated on 30-Jul-2019 22:30:25
In this section we will see how to find length of a string without using string header file and loops in C. The string length finding problem can be solved without string.h very easily. We can use recursive function to do it.But in this example we are not using recursion. We are using another trick to do that. We are using printf() function to get the length. The printf() function returns the number of character it has printed. If we print only that string using a printf() function, we can easily get the length of it.Example Code#include main() { ... Read More 
Updated on 30-Jul-2019 22:30:25
This example demonstrates How to display a button in random screen positionStep 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. In the above code, we have taken a button to move random position.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.util.DisplayMetrics; import android.widget.Button; import android.widget.LinearLayout; import java.util.Random; import java.util.Timer; import java.util.TimerTask; public class MainActivity extends FragmentActivity { @Override public void onCreate(Bundle savedInstanceState) ... Read More Advertisements