Connection Strings¶

MongoDB Logo
ServerDriversCloudToolsGuides
Get MongoDB
Close ×
MongoDB Stitch

Introduction
Tutorials
Users & Authentication
MongoDB Atlas
    Overview
    Configure MongoDB
        Link a MongoDB Atlas Cluster
        Define Roles and Permissions
        Filter Incoming Queries
        Enforce a Document Schema
        Configure Advanced Rules
        Specify Cluster Read Preference
        Enable Wire Protocol Connections
    Work With MongoDB
        Add Data to MongoDB
        Find Documents in MongoDB
        Update Documents in MongoDB
        Delete Documents from MongoDB
        Watch for Document Changes
        Run Aggregation Pipelines
        Connect Over the Wire Protocol
    Reference
        MongoDB Actions
        Query Roles
        Query Filters
        Document Schemas
        Connection Strings
        Service Limitations
        CRUD & Aggregation APIs
GraphQL
MongoDB Mobile
Functions
Triggers
External Services
Values & Secrets
Application Deployment
Hosting
Troubleshooting
Stitch Administration
Application Logs
Client SDKs
Release Notes

Stitch > MongoDB Atlas > Reference 

Connection Strings

On this page

Overview
Connection String Components
    Credentials
    Parameters

Overview

To connect to Stitch over the wire protocol, you must construct a MongoDB connection string that includes credentials for an application user and an application-specific appName query parameter.

URL Encoding

You must URL encode connection strings before you can use them to connect to Stitch. Connection strings in the Stitch UI are properly encoded by default.

Stitch connection strings have the following form:

mongodb://@stitch.mongodb.com:27020/?

Connection String Components
Credentials

All Stitch operations that you issue over the wire protocol run in the context of a specific application user that you specify in the connection string. The user must be registered with the Email/Password, API Key, or Custom JWT authentication provider.

The contents of connection string credentials depend on the authentication provider with which the user registered:

Email/Password API Key Authentication Custom 

Format :
Fields
The user’s registered email address.
The user’s password.
Example

joe.schmoe@company.com:SuperSecretPassword123

Parameters

Stitch requires specific connection string options that identify the application you want to connect to and the authentication provider associated with the credentials that you provide.

Stitch connection strings have the following query parameters:
Parameter Description
authMechanism This parameter should always be set to PLAIN.
authSource This parameter should always be set to $external.
appName

Uniquely identifies the application, MongoDB service, and authentication provider to which you want to connect.

The appName parameter has the following form:

::

The App ID of the Stitch application.
The name of the MongoDB Service that you want to connect to. This value will always be mongodb-atlas.

The authentication provider for which you provided credentials.

Valid values:

local-userpass
api-key
custom-token

← Document Schemas Service Limitations →

© MongoDB, Inc 2008-present. MongoDB, Mongo, and the leaf logo are registered trademarks of MongoDB, Inc.
Was this page helpful?
Yes
No

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值