Novamira WordPress MCP Server Explained: Features, Risks, and AI Capabilities

Novamira is a free and open-source WordPress MCP server developed

by the Dynamic.ooo team to create a deep connection between

artificial intelligence and WordPress websites. It allows AI agents to

directly access the WordPress environment, execute PHP code, manage

databases, control files, interact with plugin APIs, and automate

advanced website operations through modern AI clients.

Unlike many WordPress MCP servers that provide only limited

predefined tools, Novamira offers a far more flexible and powerful

architecture. Instead of restricting AI to a few fixed functions, it gives

AI access to the core capabilities of WordPress itself. Because

Novamira can securely execute PHP code inside WordPress, AI agents

can perform almost anything that WordPress can do. Developers can

also create custom AI abilities, intelligent workflows, and advanced

automation systems on top of the platform. This creates a highly

flexible environment for backend development, website management,

content automation, and AI-powered operations.

One of Novamira’s biggest advantages is its fast and simple

installation process. Setup only requires two steps. First, the Novamira

plugin is installed on the WordPress website. Then, the preferred AI

client is connected using the MCP configuration automatically

generated inside the WordPress dashboard. Novamira supports Claude

Code, Claude Desktop, Cursor, Visual Studio Code, Windsurf,

OpenCode, Zed, and many other MCP-compatible AI clients.

After installation, WordPress generates a secure Application Password

that allows authenticated communication between the AI client and the

WordPress environment. This password must remain private because it

provides direct access to website operations and AI automation

features.

Inside the WordPress dashboard, Novamira automatically generates the

commands required for MCP integration. Connecting AI clients such

as Claude Desktop or Cursor simply involves copying the generated

configuration into the MCP Server settings of the selected client. Once

the configuration is saved and the client is restarted, WordPress

becomes available as an active MCP server directly inside the AI

environment.

After enabling the “AI Abilities” option, Novamira unlocks advanced

AI-powered capabilities for the website. AI agents can automate

workflows, manage backend operations, interact with plugins, and

dynamically extend website functionality using PHP execution and

custom automation logic.

However, the same deep access that makes Novamira powerful can

also make it risky if used carelessly. Because AI agents can execute

PHP code and interact directly with WordPress internals, they may

unintentionally modify files, change plugin settings, edit PHP

functions, or perform actions that the website owner does not want.

Poorly written prompts or unrestricted permissions may cause

unwanted modifications inside the WordPress environment.

For this reason, users should always provide clear and controlled

instructions to AI agents. It is highly recommended to use backups,

staging environments, restricted permissions, and careful supervision

before enabling advanced AI automation on live production websites.

Novamira represents a major step forward in AI-

powered WordPress development by combining open-

source flexibility, MCP compatibility, deep WordPress

integration, and intelligent automation into a single

platform.

AI Engine vs AI Power: Best AI Plugin for WordPress in 2026

Meow Apps is a well-known WordPress development company recognized for creating advanced artificial intelligence tools for modern websites. The company is best known for developing AI Engine, one of the most powerful AI plugins for WordPress. Meow Apps focuses on integrating modern AI technologies such as ChatGPT, Google Gemini, Claude AI, image generation, embeddings, automation, and intelligent workflows directly into WordPress websites. Its tools are designed for developers, businesses, bloggers, and website owners who want to bring artificial intelligence into content creation, customer support, SEO optimization, and website automation.

AI Engine, developed by Meow Apps, is an advanced AI plugin for WordPress that transforms websites into intelligent AI-powered platforms. The plugin supports OpenAI models like ChatGPT and GPT APIs, Google Gemini, Anthropic Claude, and several other modern AI systems. AI Engine allows users to create AI chatbots, generate SEO-friendly articles, produce AI-generated images, build custom AI forms, and automate content workflows directly inside the WordPress dashboard. One of its strongest features is support for embeddings and Retrieval-Augmented Generation (RAG), enabling websites to build intelligent knowledge bases and context-aware AI assistants. AI Engine also provides extensive developer APIs, deep WordPress integration, and support for MCP (Model Context Protocol), making it highly attractive for developers and advanced AI projects.

AI Power is another popular WordPress AI plugin that competes with AI Engine in the growing AI website ecosystem. AI Power focuses more on simplicity, beginner-friendly setup, and fast AI content creation for bloggers, marketers, and general website owners. Similar to AI Engine, it supports OpenAI, Google Gemini, and Claude AI models while offering chatbot functionality, AI content generation, and AI image creation tools. However, AI Power provides a more simplified experience with fewer advanced developer tools and less complex AI workflow customization.

When comparing AI Engine and AI Power, both plugins provide strong AI chatbot capabilities, AI-assisted content generation, AI image creation, and support for modern AI models such as ChatGPT, Gemini, and Claude. However, AI Engine stands out because of its deeper WordPress integration, advanced automation features, extensive APIs, and stronger embeddings and RAG support. This allows developers to create more intelligent and scalable AI systems directly inside WordPress websites. AI Power, on the other hand, prioritizes ease of use and simplified AI functionality, making it more suitable for users who want quick AI integration without advanced configuration.

AI Engine is generally considered the better solution for developers, AI enthusiasts, automation projects, and websites requiring advanced AI functionality. Because it provides deeper system access and more powerful automation tools, careful configuration is recommended on live production websites. AI Power is often considered safer and easier for beginners because it offers more controlled functionality with fewer advanced system-level features. Ultimately, AI Engine is ideal for advanced AI integration and custom WordPress development, while AI Power is best suited for bloggers, marketers, and users seeking simple AI-powered website tools.

AI Engine for WordPress

AI Engine WordPress plugin dashboard interface showing AI content generation, AI chatbot, SEO optimization, OpenAI integration, and AI image generation features for WordPress websites.

What if your WordPress website could automatically

write blog posts, generate AI images, create SEO titles,

summarize articles, and even chat with your visitors

like ChatGPT? Thanks to modern artificial intelligence

tools, this is now possible directly inside WordPress.

One of the most powerful plugins currently available

for this purpose is AI Engine, a feature-rich WordPress

AI plugin developed by Jordi Meow. This plugin

connects your website to OpenAI, the same technology

behind ChatGPT, and allows website owners,

bloggers, developers, and businesses to integrate

advanced AI tools into their WordPress dashboard

without complicated coding.

AI Engine is designed to make content creation and website

management faster, easier, and more efficient. After installing the

plugin from the WordPress plugin directory, you simply connect it to

your OpenAI API key. Once connected, your website gains access to a

wide range of AI-powered capabilities. For example, if you are writing

a technology blog, you can type a short prompt such as “Write an

article about WordPress SEO tips for beginners,” and AI Engine will

generate a complete article draft within seconds. This is extremely

useful for bloggers who regularly publish content and need help

overcoming writer’s block or generating new ideas quickly.

Another powerful feature of AI Engine is its AI Playground. This

section allows users to experiment with prompts, create summaries,

generate outlines, brainstorm article ideas, or rewrite content in

different styles. For instance, a digital marketer could ask the AI to

create five catchy SEO-friendly titles for a blog post, while an app

developer could generate a quick tutorial introduction for SwiftUI or

Flutter projects. Instead of spending hours brainstorming, AI Engine

helps accelerate the creative process directly inside WordPress.

One of the most impressive features is the integrated AI chatbot

system. AI Engine allows you to create a custom chatbot similar to

ChatGPT and place it anywhere on your website using a shortcode. For

example, an e-commerce website could use the chatbot to answer

product questions automatically, while a personal blog could use it to

engage visitors and recommend articles. The chatbot can be

customized to match your website’s personality, control response

length, and even limit topics. This makes it useful for customer

support, lead generation, and user engagement.

AI Engine also supports AI image generation using technologies such

as DALL·E and Stable Diffusion. Users can create images directly

inside WordPress by simply typing prompts like “modern minimalist

workspace with AI technology” or “futuristic mobile app interface.”

These generated visuals can be used as blog thumbnails, placeholders,

hero sections, or idea visualizations. Although it does not fully replace

professional design software like Photoshop, it dramatically speeds up

content production for bloggers and creators.

The plugin also includes tools for SEO optimization. Users can

generate SEO-friendly titles, meta descriptions, keywords, and

summaries directly from the editor. For example, if you publish articles

about MongoDB, AI Engine can automatically create optimized

headlines such as “MongoDB Indexing Explained for Beginners” or

“How MongoDB Improves Database Performance.” This helps

improve search engine visibility while saving time.

The Pro version of AI Engine unlocks even more advanced features,

including memory-based chatbots, prompt templates, AI assistants

trained on your own content, and deeper customization options. For

businesses and professional websites, these advanced capabilities can

significantly improve productivity and automation.

Overall, AI Engine is one of the most complete and

lightweight AI plugins available for WordPress today.

It combines AI content writing, chatbot systems, image

generation, and SEO tools into a single platform.

Whether you run a blog, a business website, an e-

commerce store, or a technology platform, AI Engine

provides a practical and modern way to integrate

artificial intelligence directly into your WordPress workflow.

MongoDB Indexing Explained: Create, Use, and Delete Indexes in MongoDB

MongoDB indexing infographic explaining MongoDB indexes, query optimization, createIndex(), find(), explain(), getIndexes(), dropIndex(), database performance improvement, and best practices for scalable backend applications.

What Are MongoDB Indexes?

MongoDB indexes are special data structures that

improve query performance by allowing MongoDB to

quickly locate specific documents without scanning the

entire collection.

Imagine a large library:

* Without an index, you must check every book one by

one.

* With an alphabetical index, you can directly jump to

the correct section.

MongoDB indexes work exactly the same way.

By default, MongoDB automatically creates an index

on the _id field, but developers can also create custom

indexes on other fields to optimize database searches.

⸻⸻⸻

Why Are Indexes Important in MongoDB?

Without indexes:

* MongoDB scans every document in the collection.

* Queries become slower as the database grows.

With indexes:

* MongoDB searches only the indexed data.

* Query execution becomes much faster.

* Large-scale applications perform better.

Indexes are extremely important in:

* AI applications

* Mobile applications

* Backend systems

* Real-time systems

* Large production databases

⸻⸻⸻

Sample MongoDB Employee Collection

Example document:

{

   name: “John”,

   department: “IT”,

   salary: 5000

}

⸻⸻⸻

1. MongoDB find() Command

Purpose

The find() command retrieves documents from a

MongoDB collection.

Syntax

db.employees.find()

Example

db.employees.find({ department: “IT” })

What It Does

This query returns all employees whose department is “IT”.

Problem Without Index

MongoDB may scan the entire collection to find

matching documents.

This process is called:

* Collection Scan (COLLSCAN)

On very large collections, this becomes slow.

⸻⸻⸻

2. MongoDB explain(“executionStats”)

Purpose

The explain() method shows how MongoDB executes

a query and helps analyze performance.

Syntax

db.employees.find({ department: “IT”

}).explain(“executionStats”)

Example Output

executionStats:

{

   nReturned: 3,

   totalDocsExamined: 6

}

Explanation

* nReturned

    * Number of matching documents returned.

* totalDocsExamined

    * Total documents MongoDB checked during the search.

In this example:

* MongoDB returned 3 documents.

* But it examined all 6 documents.

This is inefficient for large databases.

⸻⸻⸻

3. MongoDB createIndex()

Purpose

The createIndex() command creates an index on a field.

Indexes dramatically improve search performance.

Syntax

db.collection.createIndex({ field: 1 })

Example

db.employees.createIndex({ department: 1 })

Explanation

* department

    * Field to index.

* 1

    * Ascending order.

* -1

    * Descending order.

MongoDB creates an index named:

department_1

⸻

How MongoDB Indexes Improve Performance

After creating the index:

db.employees.find({ department: “IT” }).explain(“executionStats”)

Example result:

executionStats:

{

   nReturned: 3,

   totalDocsExamined: 3

}

Improvement

Before index:

* Examined 6 documents.

After index:

* Examined only 3 documents.

MongoDB now searches through the index first instead

of scanning the entire collection.

⸻⸻⸻

4. MongoDB getIndexes()

Purpose

Displays all indexes created in a collection.

Syntax

db.collection.getIndexes()

Example

db.employees.getIndexes()

Example Output

[

   { key: { _id: 1 }, name: “_id_” },

   { key: { department: 1 }, name: “department_1” }

]

Explanation

* _id_

    * Default MongoDB index.

* department_1

    * Custom index created on the department field.

⸻⸻⸻

5. MongoDB dropIndex()

Purpose

Deletes an existing index.

Syntax

db.collection.dropIndex(“index_name”)

Example

db.employees.dropIndex(“department_1”)

What It Does

Removes the custom index from the collection.

After deletion:

db.employees.getIndexes()

Only the default _id index remains.

⸻⸻⸻

Advantages of MongoDB Indexes

* Faster query execution

* Better application performance

* Reduced collection scanning

* Improved scalability

* Faster filtering and sorting

⸻

Disadvantages of MongoDB Indexes

* Consume additional storage

* Increase RAM usage

* Slow down insert and update operations

* Too many indexes reduce performance

* Require maintenance in large databases

⸻⸻⸻

Best Practices for MongoDB Indexing

* Create indexes only on frequently queried fields.

* Avoid unnecessary indexes.

* Use compound indexes carefully.

* Monitor performance using explain().

* Remove unused indexes regularly.

⸻⸻⸻

Conclusion

MongoDB indexes are essential for building fast and scalable applications. Without indexes, MongoDB scans entire collections, which becomes slow for large datasets. By creating indexes on frequently searched fields, developers can dramatically improve database performance and reduce query execution time.

Understanding commands like:

* find()

* explain()

* createIndex()

* getIndexes()

* dropIndex()

is fundamental for every MongoDB developer.

Coding, My New Homeland: How Dev Beats Homesickness

My Digital Escape: Coding Away Homesickness 

Coding, My new Homeland

A Modern Nomad’s Story
I sit glued to the screen, pouring my lifetime into app

development, web dev, and translating. But here’s the magic: it’s not

just work; it’s my personal sanctuary against homesickness. Away

from home? No problem – code becomes my homeland!

Why This “Screen Life” Heals My Heart:

  • Flow State Magic: Building apps/websites = total immersion.
  • Time flies, worries fade. Psychologists call it “flow” – pure joy in
  • creation!
  • Global Connections: Translating links me to cultures (Iran?
  • World?). Web dev deploys sites seen by thousands – feels like
  • “home” reaching everywhere.
  • Achievement High: Deploy an app → Instant dopamine! Beats
  • scrolling social media for nostalgia.
  • Flexible Freedom: Work from anywhere (coffee shop, hotel).
  • Homesick? Code a family chat app!

Real Talk: Balancing It Out

  • Pros: Self-reliant income, skills forever (AI can’t fully replace
  • creativity yet), pleasant routine.
  • Cons: Eye strain, isolation. I use 20-20-20 rule (every 20 min, look
  • 20 ft away for 20 sec), daily walks, video calls home.

Inspo Quote: “Code is poetry” – I turn pixels into purpose. What’s next for me?

When Code Becomes Home: A Web Developer and Translator’s Journey

My Digital Escape: Coding Away Homesickness

A Modern Nomad’s Story
I sit glued to the screen, pouring my lifetime into app development, web dev, and translating. But here’s the magic: it’s not just work; it’s my personal sanctuary against homesickness. Away from home? No problem – code becomes my homeland!

Why This “Screen Life” Heals My Heart:

  • Flow State Magic: Building apps/websites = total immersion. Time flies, worries fade. Psychologists call it “flow” – pure joy in creation!
  • Global Connections: Translating links me to cultures (Iran? World?). Web dev deploys sites seen by thousands – feels like “home” reaching everywhere.
  • Achievement High: Deploy an app → Instant dopamine! Beats scrolling social media for nostalgia.
  • Flexible Freedom: Work from anywhere (coffee shop, hotel). Homesick? Code a family chat app!

Real Talk: Balancing It Out

  • Pros: Self-reliant income, skills forever (AI can’t fully replace creativity yet), pleasant routine.
  • Cons: Eye strain, isolation. I use 20-20-20 rule (every 20 min, look 20 ft away for 20 sec), daily walks, video calls home.

Inspo Quote: “Code is poetry” – I turn pixels into purpose. What’s next for me?

Coding, My New Homeland: How Dev Beats Homesickness

Coding, My new Homeland

A Modern Nomad’s Story

I spend much of my time in front of a screen, working on app development, web development, and translation. But for me, technology is more than just work. It has become a creative space where I can focus, build, learn, and feel at home—even when I am far from home.

When everything around me feels unfamiliar, coding gives me something familiar to return to. A new Flutter project, a SwiftUI interface, or a challenging problem can quickly pull my attention away from homesickness and toward creating something useful.

Why This “Screen Life” Helps Me

  • Finding Flow: When I am deeply involved in building an app or website, hours can pass without me noticing. Solving problems and seeing an idea gradually become a working product gives me a strong sense of purpose.
  • Staying Connected: Technology has no real borders. Through development and translation, I can work with ideas, people, and cultures from different parts of the world. Even when I am physically far from home, I still feel connected.
  • The Satisfaction of Building: There is something special about turning an idea into a functioning application. Every feature completed and every problem solved provides a small sense of achievement.
  • Freedom to Work Anywhere: Development gives me flexibility. Whether I am working from home, a café, or another country, my laptop provides a familiar workspace.

More Than Just Work

Coding has gradually become part of my daily routine and identity. SwiftUI gives me the tools to create native iOS experiences, while Flutter allows me to build applications across platforms. Backend technologies and databases such as MongoDB help transform those interfaces into complete products.

Every project brings a new challenge: an interface to improve, an API to connect, a bug to solve, or a feature to design. That constant process of learning keeps me moving forward.

Keeping a Healthy Balance

Of course, spending long hours at a computer has disadvantages. Eye strain, too much sitting, and isolation are real concerns.

I try to balance screen time with regular breaks, walking, exercise, and conversations with family and friends. I also use the 20-20-20 rule: roughly every 20 minutes, I look at something about 20 feet away for at least 20 seconds.

Technology works best for me when it supports life rather than replacing it.

Turning Pixels Into Purpose

There is a well-known expression in the programming world: “Code is poetry.”

For me, that idea goes beyond writing elegant software. Coding gives structure to ideas and turns imagination into something people can actually use.

Being away from home can sometimes be difficult, but development has given me a portable creative space—a place where I can continue learning, building, and moving forward.

Wherever I open my laptop, there is another problem to solve and another idea waiting to become real.

Basic CRUD Operations

 

MongoDB CRUD Operations: A Practical Beginner’s Guide

Most applications need to store information, retrieve it, change it, and remove it. These four activities are known as CRUD: Create, Read, Update, and Delete.

This tutorial introduces MongoDB CRUD operations through a small practice database. You’ll create user records, search documents, update nested fields, and delete selected data.

Before You Begin

You need access to a running MongoDB server and the MongoDB Shell, mongosh. The examples below are shell commands, rather than code for a Node.js application.

For a local server running on the default port, open your terminal and connect with:

mongosh "mongodb://localhost:27017"

For MongoDB Atlas, use the shell connection instructions provided by your cluster. The server must be available before you can connect. MongoDB Shell documentation

Use a new practice database for these examples. Run each insertion once so you don’t create duplicate sample records.

Understand MongoDB’s Structure

MongoDB organizes data into databases, collections, and documents:

  • A database holds collections.

  • A collection holds documents.

  • A document contains fields and values, including nested objects and arrays.

For example, a blogging application might store user profiles in a users collection and articles in a posts collection.

Select a practice database:

use crud_practice

This selects the database even if it does not exist yet. MongoDB creates it when you first store data. A collection can also be created automatically by the first insertion. Databases and collections

Create: Insert Documents

Insert One User

Use insertOne() to add a single document:

db.users.insertOne({
  name: "Alex",
  email: "alex@example.com",
  address: {
    city: "New York",
    street: "Wall Street"
  },
  hobbies: ["soccer", "programming"]
})

The document contains text fields, an embedded address document, and a hobbies array.

A successful result includes acknowledged: true and an insertedId. When you omit _id, MongoDB supplies an identifier.

Insert Multiple Users

Use insertMany() with an array of documents:

db.users.insertMany([
  {
    name: "Sam",
    email: "sam@example.com",
    address: {
      city: "Chicago",
      street: "Lake Street"
    },
    hobbies: ["swimming", "reading"]
  },
  {
    name: "Jamie",
    email: "jamie@example.com",
    address: {
      city: "Los Angeles",
      street: "Main Street"
    },
    hobbies: ["exercise"]
  }
])

The result includes the identifiers of the inserted documents. MongoDB insertion methods

You can now inspect the database and its collections:

show dbs
show collections

Read: Find Documents

Retrieve All Users

An empty filter matches every document in the collection:

db.users.find({})

Find One User

Use a filter to select documents by a field value:

db.users.findOne({
  email: "alex@example.com"
})

findOne() returns one matching document, or null if there is no match.

Filter by a Nested Field

Use dot notation to access a field inside an embedded document:

db.users.find({
  "address.city": "Chicago"
})

This returns users whose address contains the city "Chicago". These examples use MongoDB’s standard CRUD query methods. MongoDB CRUD documentation

Update: Change Existing Documents

Update One Nested Field

Suppose Alex moves to Austin. Use updateOne() with $set:

db.users.updateOne(
  { email: "alex@example.com" },
  {
    $set: {
      "address.city": "Austin"
    }
  }
)

The filter selects the user. The update changes only address.city, preserving address.street.

Verify the change:

db.users.findOne({
  email: "alex@example.com"
})

The address should now contain:

{
  city: "Austin",
  street: "Wall Street"
}

Avoid Replacing an Embedded Document Accidentally

These two update expressions have different effects.

Updating one nested field:

{ $set: { "address.city": "Austin" } }

Replacing the entire address value:

{ $set: { address: { city: "Austin" } } }

The second expression removes the existing street field because the new address object contains only city.

An update result reports matchedCount and modifiedCount. A document may match without being modified if it already contains the requested value. MongoDB updateOne() reference

Update Multiple Users

Add a relationship status to every user:

db.users.updateMany(
  {},
  {
    $set: {
      relationshipStatus: "unknown"
    }
  }
)

Then change Alex’s status:

db.users.updateOne(
  { email: "alex@example.com" },
  {
    $set: {
      relationshipStatus: "single"
    }
  }
)

Inspect the users:

db.users.find({})

If you followed the examples in order, Alex has a status of "single", while Sam and Jamie have "unknown". MongoDB CRUD documentation

Replace an Entire Document

Use replaceOne() when you intend to replace a document’s contents rather than update selected fields:

db.users.replaceOne(
  { email: "jamie@example.com" },
  {
    name: "Jamie",
    email: "jamie@example.com",
    address: {
      city: "Seattle",
      street: "Pine Street"
    },
    hobbies: ["exercise", "photography"],
    relationshipStatus: "unknown"
  }
)

Fields omitted from the replacement are removed. The existing _id is preserved when it is omitted from the replacement document. MongoDB replaceOne() reference

Query Arrays and Select Returned Fields

Create a few sample posts:

db.posts.insertMany([
  {
    title: "Learning MongoDB",
    body: "An introduction to document databases.",
    author: "Alex",
    tags: ["mongodb", "learning"]
  },
  {
    title: "Swimming Basics",
    body: "Tips for beginner swimmers.",
    author: "Sam",
    tags: ["swimming", "fitness"]
  },
  {
    title: "Weekend Activities",
    body: "Ideas for an active weekend.",
    author: "Jamie",
    tags: ["swimming", "travel"]
  }
])

Match an Array Element

To find posts containing "swimming" in their tags:

db.posts.find({
  tags: "swimming"
})

This matches the second and third posts even though their arrays contain additional values.

To match an array containing exactly one element, "swimming", use:

db.posts.find({
  tags: ["swimming"]
})

That query matches none of these sample posts. Equality against an array requires the same elements in the same order. MongoDB array queries

Return Only Selected Fields

A projection controls which fields appear in query results.

Return the author of each post tagged "swimming":

db.posts.find(
  { tags: "swimming" },
  { author: 1, _id: 0 }
)

The results contain:

{ author: "Sam" }
{ author: "Jamie" }

Here, author: 1 includes the author field, and _id: 0 excludes the identifier. _id is included by default unless explicitly excluded. MongoDB projection documentation

Delete: Remove Documents

Delete One User

Remove Jamie’s record:

db.users.deleteOne({
  email: "jamie@example.com"
})

The result reports deletedCount. A value of 1 means one document was removed; 0 means nothing matched.

Check the remaining records:

db.users.find({})

Delete Multiple Users

Before deleting a group of records, inspect the filter’s matches:

db.users.find({
  relationshipStatus: "unknown"
})

Then delete those matching records:

db.users.deleteMany({
  relationshipStatus: "unknown"
})

If you followed the tutorial in order, this removes Sam. Alex remains because his status is "single".

An empty filter passed to deleteMany() removes every document in the collection. Always check the filter before running a deletion. MongoDB deletion reference

CRUD Method Reference

Operation Method Purpose
Create insertOne() Insert one document
Create insertMany() Insert multiple documents
Read find() Retrieve matching documents
Read findOne() Retrieve one matching document
Update updateOne() Update one matching document
Update updateMany() Update matching documents
Update replaceOne() Replace one matching document
Delete deleteOne() Delete one matching document
Delete deleteMany() Delete matching documents

Practice Exercise

Create a separate products collection and practice the same workflow:

  1. Insert three products with names, prices, and category arrays.

  2. Find products belonging to one category.

  3. Update one product’s price using $set.

  4. Return only product names and prices with a projection.

  5. Inspect a selected product, then delete it.

This exercise connects the individual commands into a workflow you can reuse when building an application.

MongoDb Compass Introduction – The GUI for MongoDB

Hi everyone. In this session, we’re going to take a

simple and practical look at MongoDB Compass and

understand what it is and how it helps us work more

comfortably with databases.

MongoDB Compass is the official graphical interface

for MongoDB. Instead of typing commands in the

terminal, you get a visual environment where you can

explore databases, open collections, insert documents,

run queries, and filter data. It makes working with

MongoDB much easier, especially if you prefer seeing

your data structured on the screen rather than

interacting purely through command lines.

To get started, you can download MongoDB Compass

directly from the MongoDB website under the Tools

section. Just choose the stable version for your

operating system — for example, an .exe file for

Windows — install it like any other application, and

you’re ready to connect.

When you open Compass, you’ll see a connection

string (URI). If MongoDB is installed locally, it

usually points to localhost, which means it connects to

the MongoDB server running on your own computer.

You can simply click “Connect” to access your

databases.

After connecting, you’ll see a list of databases on the

left. By default, MongoDB creates three system

databases:

  • admin
  • config
  • local

Any additional databases are ones you’ve created

yourself.

For example, suppose we open a database called

invent. Inside it, you may find several collections. In

MongoDB, a collection is similar to a table in

relational databases. If you ever need to delete a

collection, you can use the “Drop Collection” option

and confirm the action — the change happens

immediately.

Now imagine creating a new database called demoDB

with a collection named demoCollection. Once created,

you can begin inserting documents right away.

MongoDB stores data in BSON (Binary JSON), so

documents look like JSON objects. Let’s say we’re

building a small course database instead of a book

database. A sample document could look conceptually

like this:

  • title: “Mastering Flutter Development”
  • instructor: “Kia Malek”
  • durationHours: 42
  • level: “Intermediate”
  • tags: [“Flutter”, “Mobile”, “UI Design”]

When you insert this document, MongoDB

automatically generates an _id field. Even if you don’t

define it, MongoDB creates it for you. This _id

uniquely identifies each document in the collection and

ensures every record can be referenced individually.

You can insert multiple documents into a collection,

and each becomes a separate record. Compass allows

you to edit, clone, delete, or export documents directly

through its interface buttons.

Filtering is one of the most powerful features in

Compass. At the top of the documents view, there’s a

filter bar. For example, if you want to find all courses

labeled as “Intermediate,” you could type:

{ level: "Intermediate" }

and click “Find.” Compass will instantly display only

the matching documents.

If Compass fails to connect — especially when

working locally — check whether your MongoDB

server is running. On Windows, you can open the

Services app and ensure that the MongoDB Server

service is active. If it’s stopped, simply start it.

Overall, MongoDB Compass is a powerful yet

beginner-friendly tool. It helps you visualize your

database structure, test queries, manage collections,

and better understand how your data is organized —

without relying entirely on the command line.

If you’re new to MongoDB, spend some time

experimenting with Compass. Create databases, insert

sample documents, apply filters, and explore the

interface. The more you practice visually, the clearer

MongoDB concepts will become.

Stateless vs Stateful for Flutter Example

Today we’re going to talk about one of the most important concepts in Flutter: the difference between Stateless and Stateful widgets. These are two of the most common widget types you’ll work with while developing Flutter apps. If you’ve ever created a new Flutter project, you’ve already seen them in the default counter example.

So what exactly are they? In simple terms, these two widgets control whether the UI can change during the lifetime of the app. A StatelessWidget is defined as a widget that does not require mutable state. A StatefulWidget, on the other hand, is a widget that does have mutable state. The word “mutable” simply means something that can change. So when we say a widget has mutable state, we mean it can update dynamically while the app is running. A stateless widget cannot change on its own once it has been built.

To make this clearer, let’s walk through a simple example: a coin flip app. The app will display whether the coin is “Heads” or “Tails” in the app bar, and it will have a floating action button at the bottom that flips the coin when pressed. This small example clearly demonstrates the difference between stateless and stateful widgets.

We begin by creating a basic app structure with a MaterialApp and a Scaffold. Inside the Scaffold, we add an AppBar with a title that says, “The coin is …” followed by either Heads or Tails. To decide which one to show, we use a simple integer variable called coinHead and a ternary operator (a shortened if–else statement). If coinHead equals 1, we display “Heads.” Otherwise, we display “Tails.” Since we initially set coinHead to 0, the app shows “Tails” when it first runs.

Next, we add a floating action button. When pressed, it should randomly generate either 0 or 1 using Dart’s math library. In the console, we can see the value switching between 0 and 1 each time we press the button. However, something interesting happens: even though the value changes internally, the app bar text does not update. It continues to show “Tails,” even when the random number becomes 1.

At this point, we might think to use setState() to trigger a rebuild. But when we try to use setState() inside a StatelessWidget, we get an error. The message tells us that setState is not defined for this class and that the widget is marked as immutable. In other words, a StatelessWidget is not allowed to change after it has been created. That’s the key limitation.

The solution is simple: convert the widget from stateless to stateful. Both Android Studio and VS Code make this easy with a quick refactor option. Once the widget becomes a StatefulWidget, we can wrap our state changes inside setState(). Now, every time we press the button, the random value updates and the UI rebuilds. The app bar correctly switches between “Heads” and “Tails.”

In summary, use a StatelessWidget when your UI does not need to change after it is built. Use a StatefulWidget when your UI depends on values that can change over time. While the concept can become more advanced as your apps grow, this simple coin flip example gives you a solid foundation for understanding how state works in Flutter.