Database
MongoDB

Build Low-Code Visual Backend with MongoDB

MongoDB is a popular open-source, NoSQL database, falling under the category of document-oriented databases. It offers flexibility in storing data in JSON-like documents, providing users with scalability and versatility in managing their data.


MongoDB

With BuildShip X MongoDB Nodes, users can now leverage MongoDB's capabilities to create REST APIs, Scheduled Jobs, integrate with other databases like - Firestore, Supabase, and Airtable, build chatbots, and much more, all through a low-code approach.

Prerequisites ✅

Before proceeding, ensure you have a MongoDB project. If not, you can sign up here (opens in a new tab) and follow the guided walkthrough.


MongoDB
💡

QUICK TIP 💡: Make sure to add 0.0.0.0/0 under the Network Access tab to enable database access via the BuildShip MongoDB Nodes. Failure to do so might result in unsuccessful responses.

MongoDB

Database

Navigate to the Databases section in MongoDB, and create a database if one does not already exist. For security purposes, you'll be required to create a user with a username and password. Make note of the Database Name and Password for connecting BuildShip nodes to the MongoDB database.

Connection String

After creating the database user, choose a connection method. Select the driver as Node.js and copy the Connection String provided. It should look something like this:

mongodb+srv://<username>:<password>@<cluster>/<database>?retryWrites=true&w=majority

Replace <password> with the password set for your database user. Store this connection string separately as this will be required for establishing the connection later.

MongoDB

Collection

Once the Database Name, Connection String, and database setup are complete, you can either create a new collection or use an existing one for CRUD operations.

MongoDB CRUD Nodes

BuildShip currently offers the following pre-built MongoDB nodes.

⭐️

Want more MongoDB nodes? Why wait for us? Create your own custom nodes using AI, learn more.

Insert Document

The Insert Document Node allows users to add new data entries into a MongoDB collection. It takes an array of documents as input and inserts them into the specified collection within the MongoDB database. After successful insertion, it returns the IDs of the inserted documents.

MongoDB

Usage:

  • Provide the MongoDB connection string, database name, and collection name.
  • Input an array of JSON documents to be inserted into the collection.

Sample Input:

[
  {
    "_id": "document1",
    "name": "Sicilian pizza",
    "shape": "square"
  },
  {
    "_id": "document2",
    "name": "New York pizza",
    "shape": "round"
  }
]

Fetch Document

The Fetch Document Node retrieves specific documents from a MongoDB collection based on their unique Document IDs. It fetches the entire document data corresponding to the provided document IDs and returns them as output.

MongoDB

Usage:

  • Specify the MongoDB connection string, database name, collection name, and the document ID(s) to fetch.

Update Document

The Update Document Node modifies existing documents in a MongoDB collection. It uses the updateOne function to update a specific document identified by its unique ObjectID (Document ID). The node takes new JSON data as input and updates the document accordingly.

MongoDB

Usage:

  • Provide the MongoDB connection string, database name, collection name, document ID, and new JSON data for updating the document.

Sample Input:

{
  "name": "Sicilian pizza",
  "shape": "square"
}

Delete Document

The Delete Document Node removes specific documents from a MongoDB collection based on their unique IDs. It deletes document identified by the ObjectID (Document ID) from the specified collection in the MongoDB database.

MongoDB

Usage:

  • Specify the MongoDB connection string, database name, collection name, and the document ID to delete.

Query Collection

The Query Collection Node retrieves multiple documents from a MongoDB collection based on specified criteria. It allows users to query documents using parameters like the connection string, database name, collection name, query, sort, and projection.

MongoDB

Usage:

  • Provide the MongoDB connection string, database name, collection name, and query criteria.
  • Optionally, specify sorting and projection parameters to organize and filter the returned documents.

Sample Input:

  • Query to return only Pizza with a cooking time of less than 60 minutes:

    {
      "time": { "$lt": 60 }
    }
  • Sorting by name in ascending order:

    {
      "name": 1
    }
  • Projection to include only the name, time, and _id fields:

    {
      "name": 1,
      "time": 1,
      "_id": 1
    }

Need Help?

  • 💬
    Join BuildShip Community

    An active and large community of no-code / low-code builders. Ask questions, share feedback, showcase your project and connect with other BuildShip enthusiasts.

  • 🙋
    Hire a BuildShip Expert

    Need personalized help to build your product fast? Browse and hire from a range of independent freelancers, agencies and builders - all well versed with BuildShip.

  • 🛟
    Send a Support Request

    Got a specific question on your workflows / project or want to report a bug? Send a us a request using the "Support" button directly from your BuildShip Dashboard.

  • ⭐️
    Feature Request

    Something missing in BuildShip for you? Share on the #FeatureRequest channel on Discord. Also browse and cast your votes on other feature requests.