Navigation

Service Limitations

Overview

You can access most of the CRUD and Aggregation functionality of MongoDB version 3.6 with the MongoDB service; however, Stitch does not support all operations and features available in standard tools and clients. This page provides a high-level overview of MongoDB feature availability in Stitch. For a list of specific MongoDB operations that are available when you connect to MongoDB through Stitch, see the CRUD & Aggregation API reference.

Query Results

MongoDB queries executed through Stitch can return a maximum of 50,000 documents. If you need to return more documents, consider paginating your query.

Query Options

Stitch supports all query options in system functions except distinct. Stitch does not support certain options for CRUD operations run from user functions. For a list of specific options that are available when you connect to MongoDB through Stitch, see Query Options.

Aggregation

Stitch supports all aggregation pipeline stages in system functions except for $currentOp and $indexStats.

In user functions, supported aggregation pipeline stages are reduced for security reasons.

For a list of pipeline stages that are available and their allowed function context, see Aggregation.

Transactions

Stitch does not support multi-document transactions via the MongoDB service. Consider using a denormalized data model for workflows that traditionally use multi-document transactions.

Database Commands

Stitch does not support any database commands in the Client SDKs or Functions. You can, however, call a limited subset of database commands when when connected to a MongoDB cluster over the Stitch wire protocol. For a list of wire protocol supported commands, see Database Commands.

Change Streams

Stitch limits the total number of change streams open against a given cluster across all Stitch apps based on the cluster’s size. It also limits the number of client applications that can concurrently listen for changes using Watch and Mobile Sync. The following table lists the limitations for each cluster size:

Cluster Size Maximum Number of Change Streams Maximum Number of Concurrent Listening Clients
Free Tier (M0) 5 250
Shared Clusters (M2/M5) 10 500
Small, Dedicated Clusters (M10/M20) 100 1000
Standard Clusters (M30/M40) 1000 10000
Standard Clusters (M50 - M90) 1000 50000
High-Power Clusters (M100+) 1000 100000 (Contact Support for Additional Usage)

Note

Stitch opens a single change stream on each collection that is associated with a Database Trigger, Collection Sync, or Watch operation.

Usage Recommendation

To minimize the number of concurrent listening clients and open change streams:

  • Start Watch and Sync operations only when necessary. Close any open Watch and Sync streams immediately when they’re no longer necessary.
  • Avoid data models that require you to Watch or Sync an unbounded number of collections.