<?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: Pavan Gudiwada</title>
    <description>The latest articles on DEV Community by Pavan Gudiwada (@pavangudiwada).</description>
    <link>https://dev.to/pavangudiwada</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%2F1278380%2F663a3d5e-348d-46c4-accb-1424735e5c92.jpg</url>
      <title>DEV Community: Pavan Gudiwada</title>
      <link>https://dev.to/pavangudiwada</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pavangudiwada"/>
    <language>en</language>
    <item>
      <title>MongoDB and Mongoose at a high level</title>
      <dc:creator>Pavan Gudiwada</dc:creator>
      <pubDate>Mon, 10 Nov 2025 15:45:26 +0000</pubDate>
      <link>https://dev.to/pavangudiwada/mongodb-and-mongoose-at-a-high-level-lnc</link>
      <guid>https://dev.to/pavangudiwada/mongodb-and-mongoose-at-a-high-level-lnc</guid>
      <description>&lt;p&gt;This blog gives you a high level understanding of what MongoDB and Mongoose are and some basic terminologies you might encounter while working with them.&lt;/p&gt;

&lt;h2&gt;
  
  
  MongoDB
&lt;/h2&gt;

&lt;p&gt;MongoDB is a &lt;a href="https://www.mongodb.com/resources/basics/databases/nosql-explained" rel="noopener noreferrer"&gt;NoSQL&lt;/a&gt; database that lets you store data as “documents”. It is one of the four types of NoSQL databases. Here’s what the hierarchy of MongoDB looks like:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Term&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;What is it?&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Cluster&lt;/td&gt;
&lt;td&gt;Highest layer in MongoDB.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Database&lt;/td&gt;
&lt;td&gt;Group of collections. Used to group data and setting permissions.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Collection&lt;/td&gt;
&lt;td&gt;A group of related documents which need not follow the same structure. Some can have extra fields and some without them.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Document&lt;/td&gt;
&lt;td&gt;Individual data stored as binary JSON object. This is your actual data.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Mongoose
&lt;/h2&gt;

&lt;p&gt;Mongoose is an &lt;a href="https://www.npmjs.com/package/mongoose" rel="noopener noreferrer"&gt;NPM library&lt;/a&gt; that makes it easy for you to connect to any MongoDB cluster and perform CRUD (Create, Read, Update, Delete) operations.&lt;/p&gt;

&lt;p&gt;Here’s what you need to know to work with Mongoose&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Term&lt;/th&gt;
&lt;th&gt;What is it?&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Cluster Connection&lt;/td&gt;
&lt;td&gt;The &lt;strong&gt;Mongoose Connection&lt;/strong&gt; (e.g., &lt;code&gt;mongoose.connect()&lt;/code&gt;) creates a way for you to communicate with your cluster&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Schema&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;It defines the structure, types, validation, and defaults&lt;/strong&gt; for the documents. Created using &lt;code&gt;new mongoose.Schema()&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Model&lt;/td&gt;
&lt;td&gt;A class/constructor compiled from the Schema (&lt;code&gt;mongoose.model()&lt;/code&gt;). You will use the model to get data from the Collection.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Data (Document)&lt;/td&gt;
&lt;td&gt;This is the object you create and manipulate in your application. It’s an instance of Model, meaning it’s like the template your data should fit into. It’s crated using &lt;code&gt;const newUser = new User(data)&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Save&lt;/td&gt;
&lt;td&gt;Turns the data into a binary JSON object and sends it to your cluster to be written to the Collection in the Database. You’ll use the &lt;code&gt;.save()&lt;/code&gt;command to save your document.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;While this is not extensive, it can serve as a refresher or reference when necessary. &lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

</description>
      <category>mongodb</category>
      <category>mongoose</category>
      <category>node</category>
      <category>database</category>
    </item>
  </channel>
</rss>
