<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Prasanna Kumar T</title>
    <description>The latest articles on DEV Community by Prasanna Kumar T (@prasanna_kumart_).</description>
    <link>https://dev.to/prasanna_kumart_</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3459495%2F4fac0223-e3bd-470d-a4d3-5b5d69dc04ac.png</url>
      <title>DEV Community: Prasanna Kumar T</title>
      <link>https://dev.to/prasanna_kumart_</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/prasanna_kumart_"/>
    <language>en</language>
    <item>
      <title>Understanding 6 Common Data Formats in Data Analytics</title>
      <dc:creator>Prasanna Kumar T</dc:creator>
      <pubDate>Tue, 07 Oct 2025 15:44:58 +0000</pubDate>
      <link>https://dev.to/prasanna_kumart_/understanding-6-common-data-formats-in-data-analytics-22b1</link>
      <guid>https://dev.to/prasanna_kumart_/understanding-6-common-data-formats-in-data-analytics-22b1</guid>
      <description>&lt;p&gt;In the world of data analytics, the way we store and share data matters just as much as the insights we gain from it. Different formats are optimized for different purposes — whether it’s human readability, query speed, or compression efficiency.&lt;/p&gt;

&lt;p&gt;In this blog, let’s explore six widely used data formats:&lt;br&gt;
CSV | SQL | JSON | Parquet | XML | Avro&lt;/p&gt;

&lt;p&gt;We’ll use the same simple dataset and represent it in all six formats.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sample Dataset:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let’s take a small example of student marks:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fibwxwgeubrs9hbx941c6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fibwxwgeubrs9hbx941c6.png" alt=" " width="800" height="202"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. CSV (Comma-Separated Values)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;CSV is one of the simplest and most widely used data formats. Each line represents a record, and each field is separated by a comma.&lt;br&gt;
It’s human-readable, lightweight, and easy to open in Excel or Google Sheets.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dataset Representation (CSV):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh25aq164qrm1tadf4zk0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh25aq164qrm1tadf4zk0.png" alt=" " width="403" height="116"&gt;&lt;/a&gt;&lt;br&gt;
✅ Pros: Easy to read, supported by all tools&lt;br&gt;
❌ Cons: No data types, no schema, not efficient for large data&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. SQL (Relational Table Format)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;SQL stores data in tables with rows and columns. Data can be inserted using SQL statements.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dataset Representation (JSON):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn4cp7u4b3tptqoofuh5y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn4cp7u4b3tptqoofuh5y.png" alt=" " width="710" height="368"&gt;&lt;/a&gt;&lt;br&gt;
✅ Pros: Structured, supports queries and relationships&lt;br&gt;
❌ Cons: Not ideal for semi-structured or nested data&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. JSON (JavaScript Object Notation)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;JSON is a lightweight, text-based format used to store structured and semi-structured data.&lt;br&gt;
It’s commonly used in APIs and NoSQL databases like MongoDB.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dataset Representation (JSON):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fprlosky6ep14yqqx8ipp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fprlosky6ep14yqqx8ipp.png" alt=" " width="390" height="649"&gt;&lt;/a&gt;&lt;br&gt;
✅ Pros: Human-readable, supports nested structures&lt;br&gt;
❌ Cons: Larger file size, slower parsing for very big data&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Parquet (Columnar Storage Format)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Apache Parquet is a binary columnar format optimized for analytical queries in big data systems like Hadoop, Spark, and AWS Athena.&lt;br&gt;
It stores data by columns, allowing faster reads for specific fields.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dataset Representation (Parquet):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Parquet is a binary format, so you can’t read it directly like text.&lt;br&gt;
However, the same dataset conceptually looks like this when stored in Parquet:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fipo2pf7732yh6cw6z7pp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fipo2pf7732yh6cw6z7pp.png" alt=" " width="800" height="254"&gt;&lt;/a&gt;&lt;br&gt;
In Python (using PyArrow or Pandas), you’d write:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk2kimlodgsgw0vtqn17e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk2kimlodgsgw0vtqn17e.png" alt=" " width="701" height="263"&gt;&lt;/a&gt;&lt;br&gt;
✅ Pros: Highly efficient, supports compression, great for analytics&lt;br&gt;
❌ Cons: Not human-readable&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. XML (Extensible Markup Language)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;XML is a markup language similar to HTML that represents data with tags.&lt;br&gt;
It’s self-descriptive and widely used in web services and configuration files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dataset Representation (XML):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdpnhevs64g5hrbv9cvkg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdpnhevs64g5hrbv9cvkg.png" alt=" " width="437" height="657"&gt;&lt;/a&gt;&lt;br&gt;
✅ Pros: Hierarchical, supports metadata&lt;br&gt;
❌ Cons: Verbose, larger file size, slower parsing&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Avro (Row-Based Storage Format)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Apache Avro is a binary row-based format often used in data streaming and serialization (especially with Apache Kafka).&lt;br&gt;
It stores data with a schema, making it compact and fast.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dataset Representation (Avro Schema + Example):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Schema (in JSON):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwfavmtrf9r4igbl6amlb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwfavmtrf9r4igbl6amlb.png" alt=" " width="501" height="325"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Sample Data (Avro JSON representation):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft3mtqjhqzznmkd002zr9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft3mtqjhqzznmkd002zr9.png" alt=" " width="800" height="205"&gt;&lt;/a&gt;&lt;br&gt;
✅ Pros: Compact, schema-based, great for streaming&lt;br&gt;
❌ Cons: Requires tools to read/write (not human-readable)&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>data</category>
    </item>
    <item>
      <title>MongoDB Hands-on: Working with a Zomato Restaurants Dataset</title>
      <dc:creator>Prasanna Kumar T</dc:creator>
      <pubDate>Tue, 26 Aug 2025 04:43:34 +0000</pubDate>
      <link>https://dev.to/prasanna_kumart_/mongodb-hands-on-working-with-a-zomato-restaurants-dataset-5ad4</link>
      <guid>https://dev.to/prasanna_kumart_/mongodb-hands-on-working-with-a-zomato-restaurants-dataset-5ad4</guid>
      <description>&lt;p&gt;This professional guide demonstrates a compact, repeatable workflow for common MongoDB tasks using a Zomato-style restaurants dataset. It covers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;inserting sample documents,&lt;/li&gt;
&lt;li&gt;computing top restaurants by rating,&lt;/li&gt;
&lt;li&gt;counting reviews that mention the word “good”,&lt;/li&gt;
&lt;li&gt;fetching all reviews for a restaurant,&lt;/li&gt;
&lt;li&gt;updating and deleting records, and&lt;/li&gt;
&lt;li&gt;exporting results as JSON/CSV.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All commands are ready to paste into mongosh (except mongoexport, which runs in your system terminal). The examples assume a database named zomato and a collection named restaurants.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dataset shape (example document)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Typical document structure used in the examples:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F86ciqrgzrjum3o9lp823.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F86ciqrgzrjum3o9lp823.png" alt=" " width="779" height="328"&gt;&lt;/a&gt;&lt;br&gt;
Note: the rate field in this dataset is a string of the form "4.1/5". Queries below show how to parse the numeric portion.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Insert at least 10 sample records&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Use &lt;em&gt;insertMany&lt;/em&gt; to add sample documents if you don’t already have data.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx2csxm7jjprmv9490kmx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx2csxm7jjprmv9490kmx.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh09vlbsk5orrijel6hxv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh09vlbsk5orrijel6hxv.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Top 5 restaurants by rating&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Because &lt;em&gt;rate&lt;/em&gt; is stored as "&lt;em&gt;4.1/5&lt;/em&gt;", use &lt;em&gt;$split&lt;/em&gt; + &lt;em&gt;$toDouble&lt;/em&gt; to convert it to a numeric value, then aggregate and sort. The pipeline below computes an average per restaurant (useful if a restaurant has multiple documents).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3qyryzxrdywf91wyo2sx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3qyryzxrdywf91wyo2sx.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F654o3ilmpet8qebdl4sf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F654o3ilmpet8qebdl4sf.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
What this returns: top 5 restaurant names with their average numeric rating and total votes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Count reviews that contain the word “good” (case-insensitive)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If &lt;em&gt;reviews_list&lt;/em&gt; is an array of subdocuments with a review text field:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3zjv0hqzp3i0n4glrzqp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3zjv0hqzp3i0n4glrzqp.png" alt=" " width="671" height="55"&gt;&lt;/a&gt;&lt;br&gt;
Notes:&lt;/p&gt;

&lt;p&gt;This counts documents (restaurants) where at least one review contains “&lt;em&gt;good&lt;/em&gt;”.&lt;/p&gt;

&lt;p&gt;If you need the exact count of matching reviews across all documents, use &lt;em&gt;$unwind&lt;/em&gt; and &lt;em&gt;$match&lt;/em&gt; then &lt;em&gt;$count&lt;/em&gt;:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Retrieve all reviews for a specific restaurant (by name)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Replace "&lt;em&gt;Jalsa&lt;/em&gt;" with the restaurant of interest.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy0y5yvwrmz2gn10vlh7e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy0y5yvwrmz2gn10vlh7e.png" alt=" " width="775" height="412"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Update a review and delete a record&lt;br&gt;
Update one matching review (in-place)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Example: update a review in &lt;em&gt;San Churro Cafe&lt;/em&gt; whose text mentions “&lt;em&gt;Ambience&lt;/em&gt;”.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F64125o9i96ecc2u6toeo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F64125o9i96ecc2u6toeo.png" alt=" " width="800" height="345"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Delete a record (example: remove "Spice Elephant")&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb5gdwuu51ix2sfgey9sp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb5gdwuu51ix2sfgey9sp.png" alt=" " width="547" height="171"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Export results as JSON/CSV&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Important: mongoexport is a command-line tool. Run these commands in your system terminal (PowerShell, Bash, or Command Prompt), not inside mongosh.&lt;/p&gt;

&lt;p&gt;Export entire collection as JSON&lt;/p&gt;

&lt;p&gt;mongoexport --db=zomato --collection=restaurants --out=restaurants.json&lt;/p&gt;

&lt;p&gt;Export selected fields as CSV&lt;/p&gt;

&lt;p&gt;mongoexport --db=zomato --collection=restaurants \&lt;br&gt;
  --type=csv --fields=name,location,rate,votes,cuisines \&lt;br&gt;
  --out=restaurants.csv&lt;/p&gt;

&lt;p&gt;Export the Top 5 aggregation result (recommended approach: write the aggregation to a temporary collection, then export):&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Write the aggregation to a collection named top5_restaurants:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhe4mmi4gref4jn8mkgvi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhe4mmi4gref4jn8mkgvi.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Export that collection:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;mongoexport --db=zomato --collection=top5_restaurants --out=top5_restaurants.json&lt;br&gt;
mongoexport --db=zomato --collection=top5_restaurants --type=csv --fields=_id,location,avgRating,totalVotes --out=top5_restaurants.csv&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Authentication / remote server:&lt;/strong&gt; if your MongoDB uses authentication or is remote, supply --uri with the full connection string:&lt;/p&gt;

&lt;p&gt;mongoexport --uri="mongodb://user:pass@host:27017/zomato" --collection=restaurants --out=restaurants.json&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Practical notes &amp;amp; best practices&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run mongoexport from the OS terminal — not from mongosh. Running it inside the shell causes a syntax error.&lt;/li&gt;
&lt;li&gt;Normalize numeric fields: if you will frequently query by rating, consider storing rate_num as a numeric field (e.g., 4.1) during ingestion to simplify queries and improve performance.&lt;/li&gt;
&lt;li&gt;Text search: for more advanced review searches (stemming, ranking), consider enabling text indexes and using $text.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Backups:&lt;/strong&gt; keep JSON exports of critical collections for reproducibility and backup.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Closing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This guide supplies a compact, production-minded set of queries and commands you can use to demonstrate MongoDB skills on the Zomato dataset. Use the commands as-is in mongosh and run the mongoexport commands from your terminal to produce JSON/CSV deliverables.&lt;/p&gt;

</description>
      <category>backenddevelopment</category>
      <category>mongodb</category>
      <category>dataexport</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
