Anvi Jain has Published 633 Articles

Auto increment in MongoDB to store sequence of Unique User ID?

Anvi Jain

Anvi Jain

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

542 Views

To auto increment in MongoDB to store a sequence of unique user id, let us create a collection which contains information about last sequence values of all documents.Let us first create a collection. The query to create a collection which is as follows −> db.createSequenceDemo.insertOne({_id:"SID", S_Value:0}); { "acknowledged" : true, ... Read More

Assigning multiple characters in an int in C language

Anvi Jain

Anvi Jain

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

278 Views

The character type data is stored by its ASCII value internally in C or C++. If we want to print a single character as integer, we will get the ASCII value. But when we are trying to print more than one character using a single quote, then it will print ... Read More

__func__ identifier in C

Anvi Jain

Anvi Jain

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

235 Views

Here we will see what is the __func__ C.Basically the __func__ or __FUNCTION__ (Some old versions of C and C+ + supports __func__). This macro is used to get the name of the current function.Example#include void TestFunction(){    printf("Output of __func__ is: %s", __func__ ); } main() {    printf("Output ... Read More

How to remove duplications from unsorted linked list in android?

Anvi Jain

Anvi Jain

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

72 Views

This example demonstrate about How to remove duplications from unsorted linked list in android.Step 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

The contains() method of the Java Octet Tuple

Anvi Jain

Anvi Jain

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

55 Views

If you want to search whether a particular value exist in the Java Octet Tuple, you need to use the contains() method.For example, to find the element “Motherboard”, use it like this −boolean res = oc.contains("Motherboard");As shown above, we have used boolean i.e. the contains() method returns a boolean value; ... Read More

How to remove an element from a doubly-nested array in a MongoDB document?

Anvi Jain

Anvi Jain

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

2K+ Views

To remove an element from a doubly-nested array in MongoDB document, you can use $pull operator.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.removeElementFromDoublyNestedArrayDemo.insertOne(    ... {       ... "_id" : ... Read More

Rename function in C/C++

Anvi Jain

Anvi Jain

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

279 Views

The C library function int rename(const char *old_filename, const char *new_filename) causes the filename referred to by old_filename to be changed to new_filenameFollowing is the declaration for rename() function.int rename(const char *old_filename, const char *new_filename)The parameters are old_filename − This is the C string containing the name of the file ... Read More

How to find middle element in a array in android?

Anvi Jain

Anvi Jain

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

93 Views

This example demonstrate about How to find middle element in a array in android.Step 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

How to search for a value in Java Ennead Tuple

Anvi Jain

Anvi Jain

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

52 Views

To search for a value in Ennead Tuple in Java, use the contains() method. The value you want to search is to be set as the parameter of the method. The contains() method returns a Boolean value i.e TRUE if the value exist, else FALSE. Let us first see what ... Read More

Comparing dates in MySQL ignoring time portion of a DateTime field?

Anvi Jain

Anvi Jain

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

675 Views

To compare dates in MySQL except time portion of a datetime field, you can use DATE() function. The syntax is as follows −select *from yourTableName where date(yourColumName) = yourDate;To understand the above concept, let us create a table. The query to create a table is as follows −mysql> create table ... Read More

Advertisements