- Home
- Integrations
- MongoDB
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
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
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
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
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
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
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