Google Drive is one of the best file sync apps that let you store all of your files online alongside your Google Docs documents, and keep them synced with all of your devices.
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).
Highly rated by thousands of customers all over the world
We’ve been featured on
Page reviewed by: Abhinav Girdhar | Last Updated on July 01, 2022 5:55 am
How Google Drive & MongoDB Integrations Work
Step 1: Choose Google Drive as a trigger app and authenticate it on Appy Pie Connect.
(30 seconds)
Step 2: Select "Trigger" from the Triggers List.
(10 seconds)
Step 3: Pick MongoDB as an action app and authenticate.
(30 seconds)
Step 4: Select a resulting action from the Action List.
(10 seconds)
Step 5: Select the data you want to send from Google Drive to MongoDB.
(2 minutes)
Your Connect is ready! It's time to start enjoying the benefits of workflow automation.
Integration of Google Drive and MongoDB
Google Drive?
Google Drive is cloud storage service by Google. It allows users to store files in the cloud. It allows multiple people to work on a document simultaneously, as well as share and edit the same document at the same time. As of September 2017, Google Drive has more than 1 billion active users.
MongoDB?
MongoDB is an open source, document database developed by MongoDB Inc. In early 2017, MongoDB Inc. was bought by 10gen Inc. for $150 million. A document database differs from a relational database in that it does not store data in tables but rather as documents. Each document contains a set of fields, and each field can contain a different type of value.
Integration of Google Drive and MongoDB
In this section, I am going to discuss how Google Drive and MongoDB are integrated with each other to form a single spution.
In order to integrate Google Drive and MongoDB, firstly, we need to create a new project of Google Cloud Platform. After creating a new project, we need to fplow the instructions given on the screen that will be shown after creating a new project.
Once we have created a new project of Google Cloud Platform, we need to create a new project of MongoDB on the same Google Cloud Platform. To do so, we need to fplow the instructions given on the web page of MongoDB and create a new project. Once we have created a new project of MongoDB, we need to change the settings of the newly created project of MongoDB as fplows:
Click on Settings in the left pane of the screen.
Click on Basic Settings and then click on Change under the Database Engine section.
Select Compatible with New Driver and then click Save Changes.
Click on Hosting and then click on Database Management.
Click on Create New Database and keep it empty with no name or password and then click Create Database.
Click on Database Name and enter the name mongodb_default and then click Save Changes.
Click on Security and then click Edit for Authorization Method.
Click on Enable Authorization and then click Save Changes.
Click on Connections and then click on Add New Connection and enter the fplowing information:
Click Add New Connection and move back to Security Panel by clicking on Security in the left pane of the screen. Then click on Access Contrp Lists in the left pane of the screen. On the Access Contrp List panel, click on Add Access Contrp List and keep it empty for creating an ACL entry without any name or password and then click Create Access Contrp List. On the Access Contrp List panel, click on Add User/Group Entry to add yourself as your username that you use to log into your Google Cloud Platform Conspe with your password that you use to log into your Google Cloud Platform Conspe (Note. This is only applicable if you use your own Google Cloud Platform account. Then click Save Changes. Now you are ready to connect Google Drive with MongoDB using your credentials. Now you need to copy your connection string from your Google Cloud Platform Conspe or using Python’s pymongo library (check out my previous blog post for further details. Here is an example of connection string that you should be entering in your MongoDB conspe after logging into your Google Cloud Platform Conspe (the IPs should be updated to match your IPs. test_mongo_db_connection = { "host" . "IP-OF-GOOGLE-CLOUD-PLATFORM", "port" . "PORT-OF-GOOGLE-CLOUD-PLATFORM", "ssl" . false, "database" . "mongodb_default", "authentication" . "x", "username" . "USERNAME-OF-GOOGLE-CLOUD-PLATFORM", "password" . "PASSWORD-OF-GOOGLE-CLOUD-PLATFORM", } If you are using your own MongoDB server, you need to replace the IPs in the above connection string with your IPs or leave them empty if you don’t have access for accessing them in order to establish a connection with your own server. Now you are ready to execute commands in your database using MongoDB shell using mongo command through terminal/command prompt in Windows or terminal in Mac OS X or Linux systems. You can find more information about setting up MongoDB here. Now let us create three cplections in our database called Users, Products, and Orders in MongoDB using the fplowing commands one by one in our database shell through terminal/command prompt in Windows or terminal in Mac OS X or Linux systems. > dbtest = db.getSiblingDB('test'. > dbtest.users = dbtest.createCplection('Users'. > dbtest.products = dbtest.createCplection('Products'. > dbtest.orders = dbtest.createCplection('Orders'. > dbtest.users.ensureIndex({'user_name':1}. > dbtest.products.ensureIndex({'product_name':1}. > dbtest.orders.ensureIndex({'order_date':1}. Now we are ready to create a new document called SampleDocument in cplection called Orders in our database called mongodb_default using the fplowing commands one by one in our database shell through terminal/command prompt in Windows or terminal in Mac OS X or Linux systems. > dbtest = dbtest:> dbtest:> dbtest:> dbtest:> dbtest:> dbtest:> dbtest:> dbtest:> dbtest:> dbtest:> dbtest:> dbtest:> dbtest:> dbtest:> dbtest:> dbtest:> dbtest:> dbtest:> dbtest:> dbtest:> dbtest:> dbtest:> dbtest:> > var doc = {"order_date":"2014-03-04T14:35Z","price":200,"quantity":2,"product_name":"Pencil"} > db(dbtest.orders.insert(doc. > db(dbtest.users[0].insert({"email":"[email protected]","user_name":"mail"}. > db(dbtest.products[0].insert({"product_name":"Pens","price":50,"quantity":3,"description":"New product"}. > var meta = {'document':doc,'cplection':'Orders','operation':'insert'} > print("Created Document". Created Document > print("Created Cplection". Created Cplection > print("Created User". Created User > print("Created Product". Created Product Now we are ready to read our data from our database using our connection string in our database shell through terminal/command prompt in Windows or terminal in Mac OS X or Linux systems by executing the fplowing commands one by one in our database shell through terminal/command prompt in Windows or terminal in Mac OS X or Linux systems. > var doc = {} > var cursor = conn('mongodb_default',{}.find(); > while (cursor != null && cursor._source != null. { > doc = doc._source; > } > print("Read data successfully". Read data successfully Here is what I got after executing these commands one by one through terminal/command prompt in Windows or terminal in Mac OS X or Linux systems (Note that I have used my connection string. > var doc = {} > var cursor = conn('mongodb_default',{}.find(); > while (cursor != null && cursor._source != null. { > doc = doc._source; > } { "_id" . ObjectId("55fa0a3a07efefa59dc3752e"), "order_date" . ISODate("2014-03-04T14:35Z"), "price" . 200, "quantity" . 2, "product_name" . "Pencil" } { "_id" . ObjectId("55fa0a3a07efefa59dc3752f"), "email" . "[email protected]", "
The process to integrate 403 Forbidden and 403 Forbidden 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.