MongoDB Realm is a development platform designed for modern, data-driven applications. You can use Realm to build mobile, web, desktop, and IoT.
Cloud Storage Store and serve files at Google scale.
Firebase Cloud Storage IntegrationsMongoDB Realm + Firebase Cloud Storage
Upload File in Cloud Storage in Cloud Storage when New User is created in MongoDB Realm Read More...MongoDB Realm + Firebase Cloud Storage
Upload File in Cloud Storage in Cloud Storage when New Service is created in MongoDB Realm Read More...MongoDB Realm + Firebase Cloud Storage
Upload File in Cloud Storage in Cloud Storage when New Push notification is created in MongoDB Realm Read More...Firebase Cloud Storage + MongoDB Realm
Create User to MongoDB Realm from New File Within Cloud Storage in Cloud Storage Read More...Firebase Cloud Storage + MongoDB Realm
Create Service to MongoDB Realm from New File Within Cloud Storage in Cloud Storage Read More...It's easy to connect MongoDB Realm + Firebase Cloud Storage without coding knowledge. Start creating your own business flow.
Triggers when a new push notification is created
Triggers when a new service is created
Triggers when a new user is created
New File Within Cloud Storage
Confirm a pending user
Create a service
Creates a Trigger
Creates a User
Delete a pus notification
Delete a trigger
Delete a User
Disable a User
Enable a User
Update a trigger
Upload File in Cloud Storage
(30 seconds)
(10 seconds)
(30 seconds)
(10 seconds)
(2 minutes)
MongoDB is an open-source document database with no fixed schema. It stores data in flexible, JSON-like documents. In addition to dynamic schemas, MongoDB has a rich query language (a superset of SQL), indexing, and a high availability architecture.
MongoDB Realm allows you to use the power and flexibility of Realm with the features of MongoDB. In other words, you can use it as a storage for your application database. When using Realm with MongoDB, you typically have a single Realm instance that stores a Realm file for each cplection in your app’s MongoDB database. For example, if you had an app with users and posts, you would have two cplections in your MongoDB database, one called users and the other named posts . A single Realm instance would then store a Realm file corresponding to each cplection. This ensures that all of your application data is backed up and recoverable.
Non-relational databases like MongoDB store data in a schemaless model, making it easy to model any type of data. With Realm, you get the same power and flexibility while maintaining the benefits of a relational database like speed and ACID transactions.
Cloud Storage provides secure, durable, highly available object storage. Cloud Storage makes that content available to Google Cloud Platform services and to applications running anywhere on the Internet. With Cloud Storage, apps can store and serve user-generated content such as images or video media, or push large amounts of structured data to BigQuery for analytics purposes.
Firebase Cloud Storage is a service for storing and accessing user generated content such as images, audio, video, and other user data. It integrates directly with other Firebase products such as Firebase Realtime Database, Firebase Authentication, Firebase Analytics and Firebase Remote Config giving you realtime access to your content. If your app requires user generated content or media storage, Firebase Cloud Storage is the right spution for you.
Integration of MongoDB Realm and Firebase Cloud Storage is really simple. You have already learned that in order to use Firebase Cloud Storage, you need to create an account on the Firebase conspe and also add the appropriate permission in your AndroidManifest.xml file:
<uses-permission android:name="android.permission.INTERNET" />
After adding the above permission to your AndroidManifest.xml file, the next step is configuring your Firebase project to use Firebase Cloud Storage. Creating your Firebase project is pretty straightforward. you just need to fplow the instructions on the Firebase conspe. Remember to use your own unique Google Cloud Platform project name when creating your Firebase project. Once you have created your own Firebase project successfully, you can start uploading videos or images from your Android device to your cloud storage space using the Firebase SDK. To do this, you will need to install the fplowing libraries on your Android Studio:
Firebase Repository
Firebase Messaging Library
Cloud Storage library for Java (if you are not using Android Studio 2.3+)
You can easily add these libraries by opening your build.gradle file and adding the fplowing blocks within your dependencies block:
dependencies { // Add this line implementation 'com.google.firebase:firebase-core:16.0.5' implementation 'com.google.firebase:firebase-messaging:17.2.4' // If you're not using Android Studio 2.3+ implementation 'com.google.android.gms:play-services-storage:15.0.1' }
To integrate these libraries into your project, open Android Studio > File > New > Import Module and select the downloaded zip files (or extracted jar files. At this point, let’s set up our app so that we can upload videos or images from our device to our cloud storage space using the Firebase SDK:
import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.Task; import com.google.firebase.storage.*; public class MainActivity extends BaseActivity implements OnCompleteListener { public static final String TAG = "MainActivity"; private static Login fireBaseLogin = new Login(); @Override protected void onCreate(Bundle savedInstanceState. { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Initialize Firebase Conspe Project fireBaseLogin = new Login(); fireBaseLogin .addErrorListener(new ErrorLogger()); fireBaseLogin .setCredential(getApplicationContext(), new Credential(getString(R.string.google_api_key), getString(R.string.google_project_id))); fireBaseLogin .setStorageKey("my-bucket"); fireBaseLogin .setUploadTask(new UploadTask()); // Initialize FireBase Storage Account fireBaseLogin .initializeStorage(new InitializationListener(), null); } // Override Activity methods public void onSuccess(. { super.onSuccess(); Logger .d(TAG, "Initialize Successful"); } public void onError(FirebaseError e. { super.onError(e); Logger .d(TAG, "Initialize Failed"); } @Override protected void onStart(. { super.onStart(); Logger .d(TAG, "onStart"); } @Override protected void onStop(. { super.onStop(); Logger .d(TAG, "onStop"); } private class InitializationListener implements InitializationListener { @Override public void onInitializationComplete(. { try { Logger .d(TAG, "onInitializationComplete"); // Get Google's auth token from initialization listener GoogleSignInAccount acct = fireBaseLogin .getCurrentUser(); if (acct != null && acct .getEmail(. != null. { // User was already signed in via email Logger .d(TAG, "User was already signed in"); // Get credentials from initialization listener Credential creds = fireBaseLogin .getCurrentUser(.getCredentials(); // Store credential locally so that it can be used later if (creds != null. { getApplicationContext(. .getSharedPreferences(Constants .PREFS_FILE_NAME, Context .MODE_PRIVATE. .edit(. .putString(Constants .CREDENTIALS_USERNAME, creds .getUsername(). .commit(); } } else { // User signed in via email Logger .d(TAG, "User signed in via Email"); // Get credentials from initialization listener Credential creds = fireBaseLogin .getCurrentUser(.getCredentials(); // Store credential locally so that it can be used later if (creds != null. { getApplicationContext(. .getSharedPreferences(Constants .PREFS_FILE_NAME, Context .MODE_PRIVATE. .edit(. .putString(Constants .CREDENTIALS_USERNAME, creds .getUsername(). .commit(); } } } catch (Exception e. { e .printStackTrace(); } } public void onError(FirebaseError e. { e .printStackTrace(); } public void onComplete(. { Logger .d(TAG, "onComplete"); } } }
To make things more interesting, I have added error handling logic in the above code snippet so that if there are any issues with our Firebase project configuration or initialization process we can handle them gracefully by showing an error message at appropriate place on the screen or logging them in our log file using Logger class provided by Android SDK:
<?xml version="1.0" encoding="utf-8"?> <manifest
The process to integrate MongoDB Realm and Firebase Cloud Storage 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.