Big Data Analytics Articles

Page 110 of 135

Count the number of items in an array in MongoDB?

Daniol Thomas
Daniol Thomas
Updated on 13-Mar-2026 6K+ Views

To count the number of items in an array in MongoDB, you can use the $size operator within the $project stage of an aggregation pipeline. The $size operator returns the number of elements in a specified array field. The syntax is − db.yourCollectionName.aggregate({ $project: { anyFieldName: { $size: "$yourArrayName" } } }).pretty(); Creating a Sample Collection To understand the above syntax, let us create a collection with documents. Each document contains a StudentMarks array with a different number of elements ? ...

Read More

How to select a single field in MongoDB?

Daniol Thomas
Daniol Thomas
Updated on 13-Mar-2026 29K+ Views

You can select a single field in MongoDB using the projection parameter in the find() method. Projection lets you specify which fields to include or exclude in the query results. The syntax is − db.yourCollectionName.find( {"yourFieldName": yourValue}, {"yourSingleFieldName": 1, _id: 0} ); In the above syntax, "yourSingleFieldName": 1 means include this field in the result, and _id: 0 means exclude the _id field which MongoDB includes by default. Creating a Sample Collection To understand the above syntax, let us create a collection with documents ? db.singleFieldDemo.insertOne({"StudentName": "David", "StudentAge": 28}); ...

Read More

"Structured" grouping query in MongoDB to display result with a new field displaying the count

AmitDiwan
AmitDiwan
Updated on 13-Mar-2026 190 Views

For this, use $group in MongoDB with aggregate(). The $group stage groups input documents by the specified _id expression and for each distinct grouping, outputs a document. Structured grouping allows you to create complex grouping hierarchies and add calculated fields like counts to your results. Let us first create a collection with documents − > db.demo534.insertOne({_id:10, "ProductId":100, "ProductName":"Product-1"}); { "acknowledged" : true, "insertedId" : 10 } > db.demo534.insertOne({_id:11, "ProductId":100, "ProductName":"Product-2"}); { "acknowledged" : true, "insertedId" : 11 } > db.demo534.insertOne({_id:12, "ProductId":101, "ProductName":"Product-1"}); { "acknowledged" : true, "insertedId" : 12 } Display all documents from a ...

Read More

"Toggle" query in MongoDB?

Smita Kapse
Smita Kapse
Updated on 13-Mar-2026 471 Views

To implement a toggle query in MongoDB, you need to find the document first and then use the update operation to toggle the boolean field value. The toggle operation switches a boolean value from true to false or vice versa. Let us first create a collection with sample documents − > db.toggleDemo.insertOne({"CustomerName":"John Smith", "CustomerAge":28, "isMarried":true}); { "acknowledged" : true, "insertedId" : ObjectId("5cc7be138f9e6ff3eb0ce43b") } > db.toggleDemo.insertOne({"CustomerName":"David Miller", "CustomerAge":25, "isMarried":false}); { "acknowledged" : true, "insertedId" : ObjectId("5cc7be2e8f9e6ff3eb0ce43c") } Following is the query to display all ...

Read More

How to create a B-Tree in DBMS?

Sindhura Repala
Sindhura Repala
Updated on 28-Jan-2025 2K+ Views

A B-tree is a self-balancing tree in data structures that allows efficient storage of sorted data. Each node can hold multiple keys and have many child nodes. B-trees are versatile data structures that can efficiently handle large amounts of data. However, traditional binary search trees become inefficient for storing and searching large datasets due to their lower performance and high memory usage. B-trees, balanced trees, are self-balancing trees designed to overcome these limitations. B-trees are characterized by the large number of keys that can be stored in a single node, often called "large key" trees. Each node in a ...

Read More

Program for Fibonacci numbers in PL/SQL

Sunidhi Bansal
Sunidhi Bansal
Updated on 24-Dec-2024 13K+ Views

Given ‘n’ numbers the task is to generate the Fibonacci numbers in PL/SQL starting from 0 to n, where the Fibonacci series of integers is in the form 0, 1, 1, 2, 3, 5, 8, 13, 21, 34 Where integers 0 (1st place) and 1 (2nd place) will have a fixed place after that, the previous two digits will be added to get the integer of the next place as shown below. 0+1=1 (3rd place) 1+1=2 (4th place) 2+1=3 (5th place) and So on. Formula Sequence F(n) ...

Read More

Big Data Career Opportunities for Non Programmers

Harleen Kaur
Harleen Kaur
Updated on 25-Nov-2024 2K+ Views

Those who are not good at programming think that there is no scope for them in the field of "Big Data". Well... this is not the case. Big Data presents an extensive range of job options. Positions including data analysts, business intelligence specialists, data visualization specialists, and data governance professionals have opened up due to the increasing need for data-driven choices. Learning how to use programs like Excel, Tableau, and Power BI can help non-programmers get started in a constantly evolving industry.1. Analyst of DataIn order to find trends, patterns, and useful insights, data analysts concentrate on analyzing raw data. ...

Read More

What is shared memory architecture in parallel databases?

Bhanu Priya
Bhanu Priya
Updated on 04-Jul-2024 5K+ Views

In parallel database system data processing performance is improved by using multiple resources in parallel. In this CPU, disks are used parallel to enhance the processing performance. Operations like data loading and query processing are performed parallel. Centralized and client server database systems are not powerful enough to handle applications that need fast processing. Parallel database systems have great advantages for online transaction processing and decision support applications. Parallel processing divides a large task into multiple tasks and each task is performed concurrently on several nodes. This gives a larger task to complete more quickly. Architectural Models There are several ...

Read More

What is shared nothing architecture in parallel databases?

Bhanu Priya
Bhanu Priya
Updated on 04-Jul-2024 3K+ Views

In parallel database system data processing performance is improved by using multiple resources in parallel. In this CPU, disks are used parallel to enhance the processing performance. Operations like data loading and query processing are performed parallel. Centralized and client server database systems are not powerful enough to handle applications that need fast processing. Parallel database systems have great advantages for online transaction processing and decision support applications. Parallel processing divides a large task into multiple tasks and each task is performed concurrently on several nodes. This gives a larger task to complete more quickly. Architectural Models For Parallel Database ...

Read More

Explain the concept of secondary index in DBMS

Bhanu Priya
Bhanu Priya
Updated on 04-May-2024 4K+ Views

In secondary Index (Unique value) is created for each record in a data file which is a candidate key. Secondary index is a type of dense index and also called a non clustering index.Secondary mapping size will be small as the two levels DB indexing is used.While creating the index, generally the index table is kept in the primary memory and the main table is kept in secondary memory because of its size.A table may contain thousands of records for this reason the sparse index becomes so large which cannot be handled in primary memory.Also, if we cannot keep the ...

Read More
Showing 1091–1100 of 1,348 articles
« Prev 1 108 109 110 111 112 135 Next »
Advertisements