Arjun Thakur has Published 1109 Articles

How to get documents by tags in MongoDB?

Arjun Thakur

Arjun Thakur

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

441 Views

You can use $elemMatch operator for this. Let us create a collection with documents> db.getDocumentsByTagsDemo.insertOne({"Tags":["Tag-1", "Tag-2", "Tag-3"]}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c9eb4d5d628fa4220163b79") } > db.getDocumentsByTagsDemo.insertOne({"Tags":["Tag-2", "Tag-4", "Tag-5"]}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c9eb4d5d628fa4220163b7a") } > db.getDocumentsByTagsDemo.insertOne({"Tags":["Tag-6", "Tag-4", "Tag-3"]}); {    "acknowledged" : true, ... Read More

DoubleStream max() method in Java

Arjun Thakur

Arjun Thakur

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

168 Views

The max() method of the DoubleStream class returns an OptionalDouble describing the maximum element of this stream, or an empty OptionalDouble if this stream is empty.The syntax is as follows.OptionalDouble max()Here, OptionalDouble is a container object which may or may not contain a double value.To use the DoubleStream class in ... Read More

Rules for operator overloading in C++

Arjun Thakur

Arjun Thakur

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

14K+ Views

In C++ it supports compile time polymorphism. The examples of compile time polymorphism are the function overloading and the operator overloading.There are some rules for the operator overloading. These rules are like belowOnly built-in operators can be overloaded. If some operators are not present in C++, we cannot overload them.The ... Read More

How to store query result (a single document) into a variable?

Arjun Thakur

Arjun Thakur

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

453 Views

To store query result (a single document) into a variable, you can use var. Following is the syntaxvar anyVariableName=db.yourCollectionName.find().limit(1); yourVariableName; //Print the records;Let us first create a collection with documents> db.storeQueryResultDemo.insertOne({"ClientName":"Chris", "ClientAge":23}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c9ecf8fd628fa4220163b8d") } > db.storeQueryResultDemo.insertOne({"ClientName":"Robert", "ClientAge":21}); {    "acknowledged" : true, ... Read More

What is a config Object in JSP?

Arjun Thakur

Arjun Thakur

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

354 Views

The config object is an instantiation of javax.servlet.ServletConfig and is a direct wrapper around the ServletConfig object for the generated servlet.This object allows the JSP programmer access to the Servlet or JSP engine initialization parameters such as the paths or file locations etc.The following config method is the only one ... Read More

How can I make my layout scroll vertically?

Arjun Thakur

Arjun Thakur

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

220 Views

Before getting into example , we should know what is vertical Scroll View(Scroll View). Vertical Scroll view provide by android.widget.ScrollView class . It is used to scroll child views in vertical direction.This example demonstrate about how to use Vertical Scroll view.Step 1 − Create a new project in Android Studio, go ... Read More

8086 program to subtract two 8 bit BCD numbers

Arjun Thakur

Arjun Thakur

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

1K+ Views

In this program we will see how to subtract two 8-bit BCD numbers.Problem StatementWrite 8086 Assembly language program to subtract two 8-bit BCD number stored in memory address offset 600.DiscussionThis task is too simple. Here we are taking the numbers from memory and after adding we need to put DAS ... Read More

Find inside a hash MongoDB?

Arjun Thakur

Arjun Thakur

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

220 Views

To find inside a hash MongoDB, you can use dot(.) notation. Let us first create a collection with documents> db.hashDemo.insertOne({"ClientName":"Larry", "ClientAge":23, "ClientDetails":{ "isEducated": true, "ClientProject" : "University Management"}}); {    "acknowledged" : true,    "insertedId" : ObjectId("5ca1ef1266324ffac2a7dc5e") } > db.hashDemo.insertOne({"ClientName":"Chris", "ClientAge":26, "ClientDetails":{ "isEducated":false, "ClientProject" : "Online Book Store"}}); {   ... Read More

How to upload a file using JSP?

Arjun Thakur

Arjun Thakur

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

262 Views

Click the Below link to Know how to Upload a file Using JSPhttps://www.tutorialspoint.com/jsp/jsp_file_uploading.htm

Create Ennead Tuple from a List collection in Java

Arjun Thakur

Arjun Thakur

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

71 Views

To create Ennead Tuple from a List collection, use the fromCollection() method. Firstly, create a List like this and then create an Ennead Tuple using ListList myList = new ArrayList(); myList.add("Accessories"); myList.add("Shirt"); myList.add("Trousers"); myList.add("Furniture"); myList.add("Smart Wearable Tech"); myList.add("Smart Home Automation"); myList.add("Books"); myList.add("Stationery"); myList.add("Instrument");Let us first see what we need to ... Read More

Advertisements