Blog

  • Mongo DB as part of MERN Stack

    Why do people use Mango DB?

    MongoDB does not require a predefined schema, this allow users to store documents with varying structures within the same collection. This flexibility eliminates the need for complex JOIN operations, as related data can be embedded directly within a single document.

    As a result, MongoDB can efficiently produce aggregated results without incurring the overhead typically associated with joins in relational databases. Mongo DB supports automatic shading to scale out horizontally.

    On the other hand, PostgreSQL is a relational database that uses rows and columns with a defined schema. It offers native support for complex joins and advanced relational operations.

    Choosing between MongoDB and PostgreSQL should depend on your specific use case. If your data is well-structured and relational, PostgreSQL is likely the better choice. However, if your data is more flexible or evolving, MongoDB may be a better fit.

    To get the most out of MongoDB, it’s important to start by learning its querying methods. 🧐

    updateOne
    {$unset: {age: ""}}
    {$push: {hobbies: "swimming"}}
    {$pull: {hobbies: "Bowling"}}
    
    updateMany({address: {exists: true}}, {$unset: {address: ""}})
    
    
    // Stage 1: Filter pizza order documents by pizza size
    db.orders.aggregate( [
       {
          $match: { size: "medium" }
       },
    // Stage 2: Group remaining documents by pizza name and calculate total quantity
       {
          $group: { _id: "$name", totalQuantity: { $sum: "$quantity" } }
       }
    ] )

  • I’m Pursuing a AWS Certified Cloud Practitioner

    Why? because I can.

    I’ve been running an AWS EC2 server reliably for years, despite running with minimal (free-tier) hardware, the server efficiently hosts multiple WordPress sites for my clients, as well as my own app. Feel free to check out my planning Poker game built with vue3, nodeJS with Socket.IO –> https://smeeta.com

  • Use this post to checkout the features

    This is the heading block

    Pick your favorites

    1, 2, 3 or 4

    “Freedom is given by people with power”