[DOCS-11246] Documenting support for mongo shell to send client.application.name in initial isMaster request Created: 24/Jan/18  Updated: 29/Oct/23  Resolved: 12/Jun/18

Status: Closed
Project: Documentation
Component/s: Server
Affects Version/s: None
Fix Version/s: 3.7.2

Type: Task Priority: Major - P3
Reporter: Kay Kim (Inactive) Assignee: Allison Reinheimer Moore
Resolution: Fixed Votes: 0
Labels: connection-string, docs-grab-0511, mongo, server, uri
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

https://docs.mongodb.com/manual/reference/connection-string/#connections-connection-options


Issue Links:
Documented
documents SERVER-32094 Add support for mongo shell to send c... Closed
Related
related to SERVER-35309 Connection string option is appname; ... Closed
Participants:
Days since reply: 5 years, 35 weeks, 1 day ago
Epic Link: DOCS: 4.0 Server
Story Points: 0.7

 Description   

Documentation Request Summary:

This change now has the mongo shell support setting a custom appname parameter. So now doing:

mongo mongodb://localhost/test?appname=MyApp

Sets a custom appname which appears in db.currentOp(), db.system.profile when profiling is enabled, and in the logs.

Drivers already support this, but we have documented that the shell will always specify the appname as "MongoDB Shell" here: https://docs.mongodb.com/manual/reference/command/currentOp/#iddup.currentOp.appName
and here: https://docs.mongodb.com/manual/reference/database-profiler/#system.profile.appName
This was correct before this change, but now that is only the default.

Also I think we should add it to the connection string reference: https://docs.mongodb.com/manual/reference/connection-string/#connections-connection-options to add this under "Miscellaneous Configuration"

Engineering Ticket Description:

This likely involves adding an additional parameter to the Mongo object constructor and forwarding the metadata to the underlying DBClient instance.

Connection handshake

The isMaster handshake, as of MongoDB 3.4, supports a new argument, client, provided as a BSON object. This object has the following structure::

{
    isMaster: 1,
    client: {
        /* OPTIONAL. If present, the "name" is REQUIRED */
        application: {
            name: "<string>"
        },
        /* REQUIRED, including all sub fields */
        driver: {
            name: "<string>",
            version: "<string>"
        },
        /* REQUIRED */
        os: {
            type: "<string>",         /* REQUIRED */
            name: "<string>",         /* OPTIONAL */
            architecture: "<string>", /* OPTIONAL */
            version: "<string>"       /* OPTIONAL */
        },
        /* OPTIONAL */
        platform: "<string>"
    }
}

https://github.com/mongodb/specifications/blob/5499fd336aaa8d91bdd7cb285fa661f512be72dd/source/mongodb-handshake/handshake.rst#connection-handshake



 Comments   
Comment by Githook User [ 12/Jun/18 ]

Author:

{'username': 'schmalliso', 'name': 'Allison Reinheimer Moore', 'email': 'allison.moore@10gen.com'}

Message: DOCS-11246: add appName connection string option & clarify shell behaviour
Branch: master
https://github.com/mongodb/docs/commit/3a464632345c99d740585a147e1591dbd2f9d3be

Generated at Thu Feb 08 08:02:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.