AmitDiwan has Published 10744 Articles

JavaScript - Get the text of a span element

AmitDiwan

AmitDiwan

Updated on 11-May-2020 12:16:05

3K+ Views

To get the text of the span element in JavaScript, the code is as follows −Example Live Demo Document    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    .sample {       font-size: 18px;       font-weight: ... Read More

ImplementJavaScript Auto Complete / Suggestion feature

AmitDiwan

AmitDiwan

Updated on 11-May-2020 10:48:38

116 Views

To implement JavaScript Auto Complete / Suggestion feature, the code is as follows −Example Live Demo    body{       font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;    } JavaScript Auto Complete / Suggestion feature ... Read More

CSS Image Opacity for All Web Browsers including IE 8 and less

AmitDiwan

AmitDiwan

Updated on 11-May-2020 10:41:13

270 Views

The property opacity is the ultimate and modern solution and works for Firefox 0.9+, Safari 2, opera 9+, IE 9+ and every version of Google Chrome. The -moz-opacity property is the opacity property for Firefox versions older than 0.9 while the –khtml-opacity property is for safari versions starting with 1. ... Read More

Advanced Selectors in CSS

AmitDiwan

AmitDiwan

Updated on 11-May-2020 10:39:38

777 Views

The Advanced Selectors in CSS includes Adjacent Sibling selector, attribute selector, direct child selector, nth-of-type selector, etc. It also includes General Sibling Selector, an example is shown below:h1 ~ h3Example of direct child selector −div > spanFollowing is the code showing advanced selectors in CSS −Example Live Demo #red ... Read More

How to create CSS3 Transition Effects?

AmitDiwan

AmitDiwan

Updated on 11-May-2020 10:21:50

115 Views

To create CSS3 Transition Effects, use the transition property. Following is the code for creating transition effects using CSS3 −Example Live Demo .container div {    width: 300px;    height: 100px;    background: rgb(25, 0, 255);    border: 2px solid red;    transition: width 2s; } .container:hover div ... Read More

MongoDB aggregate to get the Mean daily average count of recorded documents in a collection?

AmitDiwan

AmitDiwan

Updated on 11-May-2020 10:07:14

851 Views

To get the mean daily average count of recorded documents, use aggregate(). Within that, use $project and $group.Let us create a collection with documents −Example> db.demo451.insertOne({ ... DueDate:new ISODate("2020-03-15T10:50:35.000Z"), ... Value: 10 ... } ... ); {    "acknowledged" : true,    "insertedId" : ObjectId("5e7b5c5d71f552a0ebb0a6e9") } > db.demo451.insertOne({ ... DueDate:new ... Read More

Implementing String Comparison in MongoDB?

AmitDiwan

AmitDiwan

Updated on 11-May-2020 10:05:23

748 Views

To implement string comparison in MongoDB, use $strcasecmp. It performs case-insensitive comparison of two strings. It returns −1 if first string is “greater than” the second string.0 if the two strings are equal.-1 if the first string is “less than” the second string.Let us create a collection with documents −> ... Read More

MongoDB query to update array object in index N?

AmitDiwan

AmitDiwan

Updated on 11-May-2020 10:04:05

289 Views

Use update() in MongoDB to update array object. The usage of dot notation is also required. Let us create a collection with documents −> db.demo489.insertOne( ... { ... ... ...    details : [{ ...       id : 101, ...       "Info1" : { ...   ... Read More

How to delete partial data in MongoDB?

AmitDiwan

AmitDiwan

Updated on 11-May-2020 10:01:57

278 Views

Set the value to be deleted in a variable To delete particle data, use remove(). Let us create a collection with documents −> db.demo488.insertOne({"Name":"Chris"});{    "acknowledged" : true,    "insertedId" : ObjectId("5e8351e0b0f3fa88e22790b2") } > db.demo488.insertOne({"Name":"David"});{    "acknowledged" : true,    "insertedId" : ObjectId("5e8351e8b0f3fa88e22790b3") } > db.demo488.insertOne({"Name":"Bob"});{    "acknowledged" : true, ... Read More

Implement a query similar to MySQL Union with MongoDB?

AmitDiwan

AmitDiwan

Updated on 11-May-2020 10:01:25

576 Views

For a similar query to UNION two collections, use JOIN in MongoDB along with aggregate(). Let us create a collection with documents −> db.demo486.insertOne({_id:1, "Amount":30, "No":4}); { "acknowledged" : true, "insertedId" : 1 } > db.demo486.insertOne({_id:2, "Amount":40, "No":2}); { "acknowledged" : true, "insertedId" : 2 } > db.demo486.insertOne({_id:3, "Amount":60, "No":6}); ... Read More

Advertisements