Arjun Thakur has Published 1109 Articles

Find the document by field name with a specific value in MongoDB?

Arjun Thakur

Arjun Thakur

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

509 Views

To find the document by field name with a specific value, you can use $exists operator. Let us create a collection with documents> db.findByFieldName.insertOne( { "Client":{ "ClientDetails":{ "ClientName":"Larry", "ClientAge":29 }, "ClientProjectDetails":{ "ProjectName":"Online Book Store", "TeamSize":10, "TechnologyUsed":"Spring Boot" } } } ); { "acknowledged" : true, "insertedId" : ObjectId("5c9e93b2d628fa4220163b64") } > ... Read More

What is Linkify Textview in android?

Arjun Thakur

Arjun Thakur

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

967 Views

Before getting into the example we should know, what is linkify. Linkify is just like a Hyper link in HTML. Using that we can browse the content. Here is the simple solution to use linkify with textview in android.Step 1 − Create a new project in Android Studio, go to ... Read More

What is the out implicit object in JSP?

Arjun Thakur

Arjun Thakur

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

401 Views

The out implicit object is an instance of a javax.servlet.jsp.JspWriter object and is used to send content in a response.The initial JspWriter object is instantiated differently depending on whether the page is buffered or not. Buffering can be easily turned off by using the buffered = 'false' attribute of the ... Read More

How to retrieve a random row or multiple random rows in MySQL?

Arjun Thakur

Arjun Thakur

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

148 Views

You can use RAND() method for this. To retrieve a random row, use the following syntaxSELECT *FROM yourTableName ORDER BY RAND() LIMIT yourIntegerNumber;To understand the above syntax, let us create a table. The query to create a table is as followsmysql> create table gettingRandomRow    -> (    -> CustomerId ... Read More

What is an arrow operator, `->` in C++?

Arjun Thakur

Arjun Thakur

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

350 Views

The dot and arrow operator are both used in C++ to access the members of a class or structure. They are just used in different scenarios. In C++, types declared as class, struct, or union are considered "of class type". So the following refers to all three of them.a.b is ... Read More

Update only specific fields in MongoDB?

Arjun Thakur

Arjun Thakur

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

670 Views

To update only specific field, you can use $set operator. Let us first create a collection with documents>db.updateOnlySpecificFieldDemo.insertOne({"EmployeeName":"John", "EmployeeCountryName":"UK"}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c9ea849d628fa4220163b72") } >db.updateOnlySpecificFieldDemo.insertOne({"EmployeeName":"Larry", "EmployeeCountryName":"US"}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c9ea853d628fa4220163b73") } >db.updateOnlySpecificFieldDemo.insertOne({"EmployeeName":"David", "EmployeeCountryName":"AUS"}); {    "acknowledged" : true,    "insertedId" ... Read More

Fetch the value from Decade Tuple in Java

Arjun Thakur

Arjun Thakur

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

71 Views

To fetch the value from Decade Tuple in Java, use the getAtX() method. Here, X represents the index value like getAt1() at index 1. This will return the element at index 1 in the Tuple.Let us first see what we need to work with JavaTuples. To work with Decade class ... Read More

How can we maintain session between Web Client and Web Server?

Arjun Thakur

Arjun Thakur

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

1K+ Views

Following are the few options to maintain the session between the Web Client and the Web Server −CookiesA webserver can assign a unique session ID as a cookie to each web client and for subsequent requests from the client they can be recognized using the received cookie.This may not be ... Read More

Operators that cannot be overloaded in C++

Arjun Thakur

Arjun Thakur

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

10K+ Views

In C++ we can overload some operators like +, -, [], -> etc. But we cannot overload any operators in it. Some of the operators cannot be overloaded. These operators are like below? “.” Member access or dot operator? “? : ” Ternary or conditional operator? “::” Scope resolution operator? ... Read More

How to add a random number between 30 and 300 to an existing field in MySQL?

Arjun Thakur

Arjun Thakur

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

81 Views

Let us first create a demo tablemysql> create table RandomNumberDemo    -> (    -> MyNumber int    -> ); Query OK, 0 rows affected (0.54 sec)Insert some records in the table using insert command. The query is as follows −mysql> insert into RandomNumberDemo values(17); Query OK, 1 row affected ... Read More

Advertisements