MongoDB Connection Configuration
  • 07 Dec 2022
  • Dark
    Light
  • PDF

MongoDB Connection Configuration

  • Dark
    Light
  • PDF

Article Summary

Note

This is a machine-translated version of the original Japanese article.
Please understand that some of the information contained on this page may be inaccurate.

summary

This page helps you configure connection information for MongoDB.

Input field

Item nameRequired
content
nameYesEnter the name of the connection information to be used inside TROCCO.
memorandumNoEnter a memo of the connection information used inside TROCCO.
Connection TypeNoPlease select from the following.
  • standard
  • DNS Seed List(SRV)
    If you are using MongoDB Atlas, select DNS Seed List (SRV ).

For more information about connection types, see the official documentation - Connection String URI Format.
hostYesEnter the hostname or IP address.
Destination portYesEnter the port number of the database to connect to. The default port number for MongoDB is 27017 .
Authentication methodNoPlease select from the following.
  • SCRAM_SHA_1
  • MONGODB_CR
  • Based on server version
    • For version 3.0 or higher: Use SCRAM_SHA_1.
    • For versions less than 3.0: Use MONGODB_CR.
For more information on authentication methods, please refer to the official documentation - Authentication.
userNoEnter your username for authentication.
passwordNoEnter your password for authentication.
Authentication DatabaseNoEnter the authentication database (authSource). If not specified, it will be.admin
Import settingsYesPlease select from the options. The default isprimary .
For details on import settings, see "About Read Preference" below.
MongoDB authentication settings

MongoDB allows you to connect without setting up user authentication.
However, TROCCO recommends that you configure the user authentication settings.

About Read Refer

For more information about import settings, please check the official documentation - Read Preferences .

Selecteditems
primary(Default) Routes all read operations to the primary node of the current replica set.
primaryPreferredRoute all read operations to the primary node. If the primary is unavailable, such as during an automatic failover, read requests are routed to the secondary node instead.
secondaryRoute all read operations to one of the secondary nodes.
secondaryPreferredRoute all read operations to one of the available secondary nodes. If the secondary is unavailable, it is routed to the primary instead.
nearestNodes with low network latency are selected for routing. Primary and secondary are treated equally.

Was this article helpful?