Nancy Den

Nancy Den

179 Articles Published

Articles by Nancy Den

Page 5 of 18

Arrow to the bottom of the tooltip with CSS

Nancy Den
Nancy Den
Updated on 15-Mar-2026 912 Views

In CSS, you can create a tooltip with an arrow pointing to the bottom by using the ::after pseudo-element to generate a triangular shape. This is achieved by manipulating border properties to create the arrow effect. Syntax .tooltip .tooltip-text::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -border-width; border-width: size; border-style: solid; border-color: tooltip-color transparent transparent transparent; } Example The ...

Read More

Rotate In Down Left Animation Effect with CSS

Nancy Den
Nancy Den
Updated on 15-Mar-2026 130 Views

The CSS rotateInDownLeft animation effect creates a smooth rotation entrance animation where an element rotates from a -90 degree angle to its normal position while fading in. The rotation occurs from the bottom-left corner of the element. Syntax @keyframes rotateInDownLeft { 0% { transform-origin: left bottom; transform: rotate(-90deg); opacity: 0; } 100% { ...

Read More

Flip Animation Effect with CSS

Nancy Den
Nancy Den
Updated on 15-Mar-2026 270 Views

The CSS flip animation effect creates a 3D rotation that makes an element appear to turn over or flip around its Y-axis. This effect uses CSS transforms and keyframes to create smooth, eye-catching animations. Syntax selector { animation: flip duration timing-function; transform: perspective(distance) rotateY(angle); } Example The following example demonstrates a flip animation effect that rotates an element 360 degrees with perspective − .flip-container { width: 200px; ...

Read More

Converting string to date in MongoDB?

Nancy Den
Nancy Den
Updated on 14-Mar-2026 1K+ Views

To convert the string to date in MongoDB, use the $dateFromString operator within an aggregation pipeline. This operator parses a string and converts it to a proper date object. Syntax db.yourCollectionName.aggregate([ { $project: { anyVariableName: { $dateFromString: { ...

Read More

Group by dates in MongoDB?

Nancy Den
Nancy Den
Updated on 14-Mar-2026 630 Views

You can use the aggregate framework to group by dates in MongoDB. The aggregation pipeline provides powerful date operators to group documents by specific date components like day, month, or year. Sample Data Let us first create a collection with some documents containing date fields ? db.groupByDateDemo.insertMany([ {"UserLoginDateTime": new ISODate()}, {"UserLoginDateTime": new ISODate("2019-01-31T15:20:09.234Z")}, {"UserLoginDateTime": new ISODate("2017-04-21T16:12:13.240Z")}, {"UserLoginDateTime": new ISODate("2016-05-25T19:11:21.130Z")}, {"UserLoginDateTime": new ISODate("2016-05-25T19:11:21.130Z")}, {"UserLoginDateTime": new ISODate()} ]); Display all documents from ...

Read More

How to change the type of a field in MongoDB?

Nancy Den
Nancy Den
Updated on 14-Mar-2026 3K+ Views

MongoDB allows you to change the data type of existing fields using update operations with type conversion functions. Let us convert a string type field to number type using the parseInt() function with an update query. Sample Data First, create a collection with a document containing different data types ? db.changeDataType.insertOne({ "StudentName": "Larry", "StudentAge": 23, "StudentZipCode": "10001", "isProgrammer": false }); { "acknowledged": true, "insertedId": ObjectId("5c6ed4976fd07954a4890694") } Display ...

Read More

How to get the last N records in MongoDB?

Nancy Den
Nancy Den
Updated on 14-Mar-2026 2K+ Views

To get the last N records in MongoDB, you need to use limit() method combined with sorting. The $natural parameter sorts documents in reverse insertion order, and limit() restricts the number of returned records. Syntax db.yourCollectionName.find().sort({$natural:-1}).limit(yourValue); Sample Data To understand the above syntax, let us create a collection with documents. The query to create a collection with documents is as follows ? db.getLastNRecordsDemo.insertMany([ {"EmployeeName": "Maxwell"}, {"EmployeeName": "Carol"}, {"EmployeeName": "Bob"}, {"EmployeeName": "Sam"}, {"EmployeeName": ...

Read More

How do you remove an array element by its index in MongoDB

Nancy Den
Nancy Den
Updated on 14-Mar-2026 2K+ Views

To remove an array element by its index in MongoDB, you can use the $unset and $pull operators in a two-step process. The $unset operator sets the array element at the specified index to null, and the $pull operator removes all null values from the array. Syntax db.yourCollectionName.update({}, {$unset: {"yourArrayListName.yourPosition": yourPositionValue}}); db.yourCollectionName.update({}, {$pull: {"yourArrayListName": null}}); Sample Data Let us create a collection with a document to demonstrate the removal process ? db.removeArrayElements.insertOne({ "StudentName": "Larry", "StudentAge": 23, "TechnicalSubject": ["C", "C++", "Java", ...

Read More

Query for documents where array size is greater than 1 in MongoDB?

Nancy Den
Nancy Den
Updated on 14-Mar-2026 779 Views

There are multiple ways to query documents where an array field has more than a certain number of elements in MongoDB. The recommended approaches are $expr with $size, or the dot notation trick with $exists. Sample Data db.students.insertMany([ {"StudentName": "Larry", "Subjects": ["Java", "C", "C++"]}, {"StudentName": "Maxwell", "Subjects": ["MongoDB"]}, {"StudentName": "Carol", "Subjects": ["MySQL", "SQL Server", "PL/SQL"]} ]); Method 1: Using $expr with $size (Recommended) db.students.find({ $expr: { $gt: [{ $size: "$Subjects" }, 1] } }).pretty(); ...

Read More

How to filter array in subdocument with MongoDB?

Nancy Den
Nancy Den
Updated on 14-Mar-2026 471 Views

To filter elements within an array subdocument in MongoDB, you can use $unwind + $match in an aggregation pipeline, or the more concise $filter operator (MongoDB 3.2+). Sample Data db.filterArray.insertOne({ "L": [{"N": 1}, {"N": 2}, {"N": 3}, {"N": 4}, {"N": 5}] }); Method 1: Using $unwind + $match + $group Unwind the array, filter matching elements, then regroup ? db.filterArray.aggregate([ { $match: { _id: ObjectId("5c6d63f2734e98fc0a434aeb") } }, { $unwind: "$L" }, { $match: { "L.N": { ...

Read More
Showing 41–50 of 179 articles
« Prev 1 3 4 5 6 7 18 Next »
Advertisements