Skip to content

[Feature]: enable hoop.dev to use connection options #1270

@robson-silva-unico

Description

@robson-silva-unico

Is your feature request related to a problem?

I'm need to set my readOnly connections from Hoop.dev to my MongoDB clusters to connect only in secondary nodes to avoid read queries in my primary nodes.

Describe the solution you'd like

I would like to ask to implement a feature to use some connection string options.

connection-string-options

or at least read-preference options and readPreferenceTags to point for use the options like

  • primary (Default)
  • primaryPreferred
  • secondary
  • secondaryPreferred
  • nearest

and a specific node with readPreferenceTags.

making hoop.dev able to use strings like

  1. mongodb+srv://:@.xxx.mongodb.net/?readPreference=secondary
  2. mongodb+srv://:@.xxx.mongodb.net/?readPreference=secondary&readPreferenceTags=nodeType:ANALYTICS

Describe alternatives you've considered

No response

Priority

Medium - Would improve my workflow

Use Case

I have some users connection on hoop.dev read-only users but exhausting a primary node resources thinking that are doing a safe query.

I tried to use this connection string
mongodb+srv://<user>:<pass>@<cluster>.xxx.mongodb.net/<myDB>?readPreference=secondary&readPreferenceTags=nodeType:ANALYTICS
but hoop.dev uses only this piece
mongodb+srv://<user>:<pass>@<cluster>.xxx.mongodb.net/<myDB>

Mockups or Examples

No response

Additional Context

No response

Contribution

  • I would be willing to submit a PR to implement this feature

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions