File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,35 @@ Frequently Asked Questions
12
12
:depth: 2
13
13
:class: singlecol
14
14
15
+ How to fix a "MongoServerSelectionError: connect ECONNREFUSED ::1:27017" error?
16
+ -------------------------------------------------------------------------------
17
+
18
+ Beginning with version 17, Node.js defaults to using ``IPV6``. You have a few
19
+ options to resolve this error:
20
+
21
+ - Start your ``mongod`` in ``IPV6`` mode with :manual:`the --ipv6 flag </reference/program/mongod/#std-option-mongod.--ipv6>`, or
22
+ setting the ``net.ipv6`` option to ``true`` :manual:`in your configuration file </reference/configuration-options/#mongodb-setting-net.ipv6>`.
23
+
24
+ .. code-block:: sh
25
+ :caption: Starting mongod with the --ipv6 flag
26
+
27
+ mongod --ipv6
28
+
29
+ .. code-block:: yaml
30
+ :caption: Setting the net.ipv6 option in the configuration file
31
+
32
+ net:
33
+ ipv6: true
34
+
35
+ - Explicitly use ``IPV4`` by specifying ``family: 4`` as an
36
+ `option to your MongoClient <{+api+}/interfaces/MongoClientOptions.html#family>`__.
37
+
38
+ .. code-block:: js
39
+
40
+ const client = new MongoClient(uri, {
41
+ family: 4,
42
+ });
43
+
15
44
16
45
What Is the Difference Between "connectTimeoutMS", "socketTimeoutMS" and "maxTimeMS"?
17
46
-------------------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments