Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(mongo): Unset the default port 27017 to avoid MongoParseError #312

Merged
merged 1 commit into from
Jul 29, 2021
Merged

fix(mongo): Unset the default port 27017 to avoid MongoParseError #312

merged 1 commit into from
Jul 29, 2021

Conversation

wxh06
Copy link
Contributor

@wxh06 wxh06 commented Jul 28, 2021

5e23361 [FIX] mongo: Unset the default port 27017 in order to avoid MongoParseError while using mongodb+srv protocol:

MongoParseError: Ports not accepted with 'mongodb+srv' URIs

The default value set in initialization is enough:

initial: '27017',

In order to avoid MongoParseError while using 'mongodb+srv' protocol:
> MongoParseError: Ports not accepted with 'mongodb+srv' URIs
@codecov
Copy link

codecov bot commented Jul 28, 2021

Codecov Report

Merging #312 (d7e1684) into develop (ce19057) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #312   +/-   ##
========================================
  Coverage    92.71%   92.71%           
========================================
  Files           58       58           
  Lines        11340    11340           
  Branches      2361     2361           
========================================
  Hits         10514    10514           
  Misses         826      826           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ce19057...d7e1684. Read the comment docs.

Copy link
Member

@undefined-moe undefined-moe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不是所有人都使用 koishi-init

请判断protocol是否为srv来决定是否补全该配置

@wxh06
Copy link
Contributor Author

wxh06 commented Jul 29, 2021

不是所有人都使用 koishi-init

请判断protocol是否为srv来决定是否补全该配置

端口留空在 URI 中会被省略,默认即为 27017,不必指定初值。

mongourl += `${host}${port ? `:${port}` : ''}/${authDatabase || name}`

@shigma shigma merged commit 11bbad7 into koishijs:develop Jul 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants