Navigation

Enable Wire Protocol Connections

On this page

Overview

You must enable wire protocol connections for a linked MongoDB cluster before you can connect to a Stitch app with a connection string. You can enable wire protocol connections for a cluster in the Stitch UI or by importing an updated MongoDB service configuration:

Procedure

1
2

Enable Connection Strings For the Cluster

Set the toggle for MongoDB Connection String to Enabled and click Save.

../../_images/enable-wire-protocol.png
1

Export Your Stitch Application

To enable wire protocol connections with stitch-cli you need to export an application directory for your application.

You can export your application from the Export tab of the Settings page in the Stitch UI, or by running the following command from an authenticated instance of stitch-cli:

stitch-cli export --app-id=<App ID>
2

Enable Wire Protocol for the Cluster

Wire protocol connections are configured in the config.json configuration file in the linked cluster’s service directory.

In the configuration file, set config.wireProtocolEnabled to true:

{
  "config": { "wireProtocolEnabled": true }
}
3

Import Your Application Directory

Ensure that the cluster configuration file is saved, then navigate to the root of the exported application directory and run the following command to import the directory:

stitch-cli import