Karthikeya Boyini has Published 2383 Articles

Convert NumberLong to String in MongoDB?

karthikeya Boyini

karthikeya Boyini

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

1K+ Views

In order to convert NumberLong to String in MongoDB, you can use toString() −NumberLong('yourValue').valueOf().toString();To convert NumberLong to String, you can use valueOf() as well −NumberLong('yourValue').valueOf();Let us implement both the above syntaxes.Following is the query to convert NumberLong to String with toString() −> NumberLong('1000').valueOf().toString();This will produce the following output −1000Following is ... Read More

HTML DOM Input Hidden form Property

karthikeya Boyini

karthikeya Boyini

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

99 Views

The HTML DOM input hidden form property returns the reference of the form that contain the hidden input field in the HTML document.SyntaxFollowing is the syntax −object.formExampleLet us see an example of HTML DOM input hidden form property − Live Demo    body{       text-align:center;   ... Read More

HTML DOM Input Image Object

karthikeya Boyini

karthikeya Boyini

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

126 Views

The HTML DOM input image Object represent the element with type=”image” of an HTML document.Let’s see how to create input image object −SyntaxFollowing is the syntax −var imageInput = document.createElement(“INPUT”); imageInput.setAttribute(“type”, ”image”);PropertiesFollowing are the properties of HTML DOM input image Object −PropertyExplanationAltIt returns and modify the value of the ... Read More

Check for Existing Document in MongoDB?

karthikeya Boyini

karthikeya Boyini

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

87 Views

You can use findOne() for this. Following is the syntax −db.yourCollectionName.findOne({yourFieldName: 'yourValue'});Let us create a collection with documents −> db.checkExistingDemo.insertOne({"StudentName":"John"}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cbdf90dac184d684e3fa265") } > db.checkExistingDemo.insertOne({"StudentName":"Carol"}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cbdf912ac184d684e3fa266") } > db.checkExistingDemo.insertOne({"StudentName":"Sam"}); {    "acknowledged" : true,   ... Read More

HTML DOM Input Month Object

karthikeya Boyini

karthikeya Boyini

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

88 Views

The HTML DOM input month Object represent the element with type=”month”.Let us create input month object −SyntaxFollowing is the syntax −var monthInput = document.createElement(“INPUT”); monthInput.setAttribute(“type”, ”month”);PropertiesFollowing are the properties of HTML DOM input month Object −PropertyExplanationautocompleteIt returns and alter the value of the autocomplete attribute of month input field.autofocusIt ... Read More

HTML DOM Input Month name Property

karthikeya Boyini

karthikeya Boyini

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

78 Views

The HTML DOM input month name property returns and modify the value of the name attribute of the input field of type=”month” in a HTML document.SyntaxFollowing is the syntax −1. Returning nameobject.name2. Modifying nameobject.name = “text”ExampleLet us see an example of HTML DOM input month name property − Live Demo ... Read More

How to select objects where an array contains only a specific field in MongoDB?

karthikeya Boyini

karthikeya Boyini

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

240 Views

Let us first create a collection with documents −> db.arrayContainOnlySpecificFieldDemo.insertOne( ...    { ...       "StudentName":"John", ...       "StudentAge":21, ...       "StudentTechnicalSubject":["C", "Java", "MongoDB"] ...    } ... ); {    "acknowledged" : true,    "insertedId" : ObjectId("5cc4921dac184d684e3fa26a") } > db.arrayContainOnlySpecificFieldDemo.insertOne( { "StudentName":"Carol", "StudentAge":23, ... Read More

HTML DOM Input Month min Property

karthikeya Boyini

karthikeya Boyini

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

57 Views

The HTML DOM input month min property returns and modify the value of the min attribute of the input field of type=”month” in an HTML document.SyntaxFollowing is the syntax −1. Returning minobject.min2. Modifying minobject.min = “YYYY-MM”Here, YYYY represent year and MM represent month like “2019-02”ExampleLet us see an example of ... Read More

HTML DOM Input Month readOnly Property

karthikeya Boyini

karthikeya Boyini

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

73 Views

The HTML DOM input month readOnly property returns and modify whether the input month field is read-only or not in an HTML document.SyntaxFollowing is the syntax −1. Returning readOnlyobject.readOnly2. Modifying readOnlyobject.readOnly = true | falseExample Live DemoLet us see an example of HTML DOM input month readOnly property− ... Read More

Change Color of Button in iOS when Clicked

karthikeya Boyini

karthikeya Boyini

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

1K+ Views

Imagine you’re playing a song and as soon as you press the stop button, the color of the button should turn to red. This is one of the many scenario where you might need to change the color of button when it is clicked.In this tutorial we will see how ... Read More

Advertisements