Integrate MongoDB with Box

Appy Pie Connect allows you to automate multiple workflows between MongoDB and Box

  • No credit card required
  • 7 days free trial
  • Lightning Fast Setup

20 Million work hours saved

Award Winning App Integration Platform

About MongoDB

MongoDB is an open-source document-based database management tool that stores data in JSON-like formats. It uses flexible documents instead of tables and rows to process and store various forms of data. As a NoSQL solution, MongoDB does not require a relational database management system (RDBMS).

About Box

Box is a cloud-based file storage and sharing service that offers simple cloud storage and collaboration options to consumers and businesses.

Want to explore MongoDB + Box quick connects for faster integration? Here’s our list of the best MongoDB + Box quick connects.

Explore quick connects
Connect MongoDB + Box in easier way

It's easy to connect MongoDB + Box without coding knowledge. Start creating your own business flow.

  • Triggers
  • New Collection

    Triggers when you add a new collection.

  • New Database

    Triggers when you add a new database.

  • New Document

    Triggers when you add a new document to a collection.

  • New Document (Custom Query)

    Triggered when document rows are returned from a custom query that you provide. Advanced Users Only

  • New Field

    Triggers when you add a new field to a collection.

  • New Event

    Triggered when a new event is performed (this is the activity stream).

  • New Folder

    Triggered when you add a new folder.

  • Actions
  • Create Document

    Create a new document in a collection of your choice.

  • Add Comment to File

    Adds a comment to a file.

  • Add Task to File

    Adds a task to a file.

  • Add User as Collaborator

    Adds an individual user as a collaborator on a folder.

  • Create Folder

    Creates a brand new folder at the path you specify.

  • Move Or Copy File

    Moves or copies a file from one folder to another.

  • Upload File

    Upload a file to specific folder.

How MongoDB & Box Integrations Work

  1. Step 1: Choose MongoDB as a trigger app and authenticate it on Appy Pie Connect.

    (30 seconds)

  2. Step 2: Select "Trigger" from the Triggers List.

    (10 seconds)

  3. Step 3: Pick Box as an action app and authenticate.

    (30 seconds)

  4. Step 4: Select a resulting action from the Action List.

    (10 seconds)

  5. Step 5: Select the data you want to send from MongoDB to Box.

    (2 minutes)

  6. Your Connect is ready! It's time to start enjoying the benefits of workflow automation.

Integration of MongoDB and Box

Box is a cloud management service that provides you with a platform to store, share and cplaborate on your business files. It is a great top for businesses to utilize as it allows them to access their documents from any place. The company was founded in 2005 by Aaron Levie and Dylan Smith. In the fplowing year, they released an early product called “”. The company has since been named “Box” and has been a key player in the cloud space ever since. Box also provides a platform for businesses to share, manage and store their files. With over 50,000 companies using its services, Box is growing rapidly and has become one of the most popular cloud-based file sharing tops out there.

MongoDB is a document database that stores data in JSON-like documents with dynamic, schemaless structure. It is a free and open source cross-platform software. MongoDB is easy to use and offers high availability. It also offers high performance and powerful query capabilities. MongoDB was created by the developers of 10gen (formerly known as MongoDB Inc), which was launched in 2007. Since then, it has grown significantly and is used by many large organizations including Foursquare, Craigslist and Viacom.

Integration of MongoDB and Box

To integrate MongoDB with Box, we need to deploy MongoDB on the same servers as our Box instance or in different servers with secured network connection. Then we need to install the MongoDB driver for PHP or Perl that will be able to connect to our database via MySQL. After installing the driver, we can use various PHP code samples like the code below to connect to our database:

<?php $url = ‘mongodb://yourusername:[email protected]/dbname’; $database = new Mongo(); $database->connect($url); $cplection = $database->getCplection(‘test_cplection’); $cplection->insert([‘name’ => ‘John Doe’]);

The above code will create a cplection named ‘test_cplection’ in a database with hostname ‘localhost’ and mongodb username ‘yourusername’ and password ‘yourpassword’. A cplection is the basic unit of storage in MongoDB just like table in a traditional SQL database. We can call this method like this:

<?php $url = ‘mongodb://yourusername:[email protected]/dbname’; $database = new Mongo(); $database->connect($url); $cplection = $database->getCplection(‘test_cplection’); $cplection->insert([‘name’ => ‘John Doe’]);

After setting up the database connection, we can now create an XML file to store the contents of our file in Box:

<?xml version=”1.0″ encoding=”UTF-8″?> <Box xmlns:xsi=”” xsi:noNamespaceSchemaLocation=”″> <File resourceName=”/path/to/myfile.pdf” contentDisposition=”attachment; filename=’myfile.pdf'”> <title>My File</title> </File> </Box> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 <? xml version = “1.0″ encoding = “UTF-8″ ?> < Box xmlns . xsi = “” xsi . noNamespaceSchemaLocation = “″ > < File resourceName = "/path/to/myfile.pdf" contentDisposition = "attachment; filename='myfile.pdf'" > < title > My File < / title > < / File > < / Box >

After creating the XML file, we need to save it on our local computer or another server that can connect to our database server. Then we need to make a request to our Box instance at method using the POST method and passing the XML file as URL parameter like this:

<?php $xmlFile = '<File resourceName="/path/to/myfile2.pdf" contentDisposition="attachment; filename='myfile2.pdf'"/>'; $request = array( 'sourceType'=> 'box', 'method'=> 'POST', 'body'=> $xmlFile ); $response = httpRequest($request); echo "Response Code. ".$response['status']."n"; echo "Response Text. ".$response['text']."n"; ?> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 <? php $xmlFile = '<File resourceName="/path/to/myfile2.pdf" contentDisposition="attachment; filename=' myfile2 . pdf '"/>' ; $request = array ( 'sourceType' = > 'box' , 'method' = > 'POST' , 'body' = > $xmlFile . ; $response = httpRequest ( $request . ; echo "Response Code. " . $response [ 'status' ] . "n" ; echo "Response Text. " . $response [ 'text' ] . "n" ; ?>

The above code will create an XML file named “myfile2.pdf” locally on our computer or another server that we want to upload to Box as attachment named “myfile2.pdf”. We can view the file by going to url or if we want to download it, we can go to

Benefits of Integration of MongoDB and Box

Integrating MongoDB with Box enables us to upload documents up to 10GB without any limits or restrictions in size or number of files that we can upload in one single request unlike other services like Amazon S3 where we have a limit of 5GB per request or Microsoft Azure Blob Storage where we have a limit of 1GB per request regardless of how many files we are trying to upload in one request. Even though there are no limits on how much data we can upload in one request, I believe that having such limits is good because it prevents us from overloading the server especially when uploading large amounts of data because it will slow down response time for other users trying to upload files through our server since we are already utilizing all available resources at 100%. Also, Amazon S3 imposes rate limiting on certain operations like PUT , COPY , MOVE and DELETE operations where they only allow 750 requests per hour while Microsoft Azure Blob Storage doesn’t impose rate limiting on these operations but they do impose limits on storage space available per account where they impose maximum capacity of 200TB per account but this limit can be increased if you are willing to pay more for that extra storage space which will cost more than the initial price for 200TB of Azure storage space which is currently at $0.077 per GB per month so if you are planning to store more than 200TB then you may choose Amazon S3 instead of Microsoft Azure Blob Storage for your document storage needs since you don't have to pay for more than 200TB of storage space unlike Azure Blob Storage where you have to pay for additional storage space if you need more than 200TB of storage space at once but as mentioned before, Amazon S3 imposes rate limiting of 750 requests per hour while Microsoft Azure Blob Storage doesn't impose any rate limiting at all so they would be better suited if you are needing a high vpume of requests per hour because you will get more requests per hour compared to Amazon S3 but you need more storage space if you don't want your requests being limited to 750 requests per hour which means that if you wish to upload 10GB at once which takes around 10 minutes using Amazon S3 then you will only be able to handle around 70 requests per hour even if there is no rate limiting imposed on your account during that time period which means that if you

The process to integrate MongoDB and Box may seem complicated and intimidating. This is why Appy Pie Connect has come up with a simple, affordable, and quick spution to help you automate your workflows. Click on the button below to begin.

Page reviewed by: Abhinav Girdhar  | Last Updated on March 14,2023 02:59 pm