MongoDB integration: find, create, update and delete documents

The MongoDB integration in nana800 finds, creates, updates and deletes documents in your MongoDB or Atlas database right from a scheme, with no server or driver code. You pick an operation from a list, name the collection and write the filter and data in JSON. Each operation costs $0.002, and your balance is topped up to $3.50 for free every month.

Build it in the builder
  • Block run: $0.002
  • Free every month: $3.50
  • No card needed

What you can do

  • Save website leads, orders and bot messages as documents, one at a time or as a list
  • Find one document or up to 1000 per run by a filter, with sorting and page by page reading
  • Update chosen fields with $set and other MongoDB operators, leaving the other fields as they are
  • Delete one or all matching documents, with no way to wipe a collection by an empty filter by mistake
  • Search by id and by date: in a filter they are written as $oid and $date
  • Build your own REST API to the database from a ready template: a webhook takes the request, the MongoDB block runs it, the answer goes back

Blocks in the builder

  • MongoDB operation

    Action · $0.002 per run

    Pick one of eight operations: FIND_ONE and FIND_MANY search, CREATE_ONE and CREATE_MANY insert, UPDATE_ONE and UPDATE_MANY update, DELETE_ONE and DELETE_MANY delete documents. Returns the documents, their count and an error text.

How to set it up

  1. 1

    Copy the connection string

    In Atlas or your hosting panel copy a string like mongodb+srv://user:password@cluster0.xxxxx.mongodb.net/dbname. Replace special characters in the password with codes, for example @ with %40. The database must be reachable from the internet: the block refuses localhost and private network addresses.

  2. 2

    Create a scheme and add a trigger

    Create a scheme in the builder and add the trigger that brings the data: a webhook for website leads, a message to a Telegram bot or a schedule. For the first test the button trigger is enough, it starts the scheme by hand.

  3. 3

    Set up the MongoDB block

    Add the Mongodb Database external operation block, paste the connection string and the collection name, for example orders. Choose the operation: CREATE_ONE for a new document, FIND_ONE or FIND_MANY to search, UPDATE_ONE to edit, DELETE_ONE to remove.

  4. 4

    Describe the filter and the data

    In the filter field write in JSON which documents you need, for example by status or by an order number from the trigger. Put the new document into the data field, and use the $set operator for updates. To update or delete every document, write the {} filter explicitly.

  5. 5

    Turn the scheme on and test it

    Turn the scheme on, press the button trigger and open the block result: result holds the documents, count their number, and error_text a clear description if something went wrong. When it works, keep the scheme on. While it is on, it costs $0.0042 per hour.

Templates with this service

  • MongoDB REST API

    A nana800 template: a webhook takes a request, the MongoDB block finds, creates, updates or deletes records in your database and returns the result. Free monthly balance.

Frequently asked questions

Each database operation costs $0.002. An enabled scheme costs $0.0042 per hour. Your balance is topped up to $3.50 for free every month, no card needed. A scheme kept on around the clock for a month spends most of that on scheme hours.

Yes, the block takes mongodb+srv:// strings from Atlas and plain mongodb:// strings from your own server. In Atlas allow connections from the internet in the network access settings. Only login and password sign in is supported: no proxy, no certificate files, no AWS, OIDC or Kerberos auth.

FIND_MANY returns 1 to 1000 documents, 100 by default. If more documents match, has_more is true in the answer: read the next page with skip 100, then 200 and so on. The whole block result must fit into 5 MB, otherwise lower the limit or narrow the filter.

Write an id as {"_id": {"$oid": "..."}} and a date as {"$date": "2025-01-01T00:00:00Z"}. In the result the block returns them as plain text: _id as a 24 character string and dates in ISO format, so they are easy to pass to other blocks.

The block does not accept an empty filter for updates and deletes. To touch every document you have to write {} explicitly. Text from other blocks inside JSON quotes is escaped, so a value from a form cannot add extra conditions to the filter.

You do not write code, but the filter and the data are JSON, the same as in MongoDB itself. To start quickly there is the Simple REST API with MongoDB template: the webhook, the MongoDB block and the response are already linked, you only paste the connection string and pick the operation.

Build your first scheme for free

Sign-up is free and needs no card. Every month the balance is topped up to $3.50 for free, enough for about 3,500 runs of basic blocks.

Build it in the builder