Navigation

MongoDB Stitch

What is Stitch?

MongoDB Stitch is a serverless platform that enables developers to quickly build applications without having to set up server infrastructure. Stitch is built on top of MongoDB Atlas, automatically integrating the connection to your database. You can connect to Stitch through the Stitch Client SDKs, which are available for many of the platforms that you develop for including JavaScript, iOS, and Android.

Create a Stitch App

What Can I Do With Stitch?

Securely Store and Query Data in MongoDB

Stitch lets you read and write the data you’ve stored in MongoDB Atlas from a serverless function or directly in your client application code. A secure, role-based rules engine ensures that your users can only read and change the data that you want them to.
_images/access-data.png

Get Started

To query MongoDB, you’ll need to link a MongoDB Atlas cluster to your Stitch application and then define roles and permissions for one or more collections in the cluster.

Use Cases

  • Allow employees to look up customers but prevent them from seeing financial details without permission.
  • Allow users to see uploaded content that they created or that another user shared with them.

Authenticate and Manage Application Users

Stitch simplifies the process of authenticating and managing your application’s users. The built-in authentication providers allow users to log in with an email/password, an API Key, or an external OAuth service. If the built-in providers don’t cover your use case, you can integrate your own custom provider.
_images/authenticate-users.png

Get Started

To authenticate your application’s users, you’ll need to configure one or more authentication providers.

Use Cases

  • Let users browse your app anonymously and then link that behavior to them when they create an account.
  • Let users choose to log in with an email and password or an existing account from another service using OAuth 2.0.

Define Backend Logic with Serverless Functions

Stitch lets you write and execute JavaScript functions that connect all of the data and services that power your application. You can call functions from client applications or from other functions, all without setting up an HTTP API.
_images/functions.png

Get Started

To execute your application’s backend logic, you’ll need to define a function and then call it from a Client SDK or another function.

Use Cases

  • Upload an image to Amazon S3 and store the image’s metadata in a MongoDB collection.
  • Condense complex or sensitive application logic into a single line of client application code.

Respond to Changes and Events

Stitch can automatically execute trigger functions in response to user authentication events or changes in your MongoDB database. You can also create incoming webhooks to allow external services to interact with your application remotely.
_images/respond-to-events.png

Get Started

To automatically respond to events, you’ll need to create a trigger or configure an incoming webhook.

Use Cases

  • Send customers an update email when their order’s shipping status changes.
  • Create a chatbot that automatically parses and responds to messages that your team posts in communication tools like Slack.