Skip to content

Commit eb7700f

Browse files
authored
add ipv6 info to faq (#425)
* add ipv6 info to faq * wording * grammar * suggestions
1 parent f99047b commit eb7700f

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

source/faq.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,35 @@ Frequently Asked Questions
1212
:depth: 2
1313
:class: singlecol
1414

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+
1544

1645
What Is the Difference Between "connectTimeoutMS", "socketTimeoutMS" and "maxTimeMS"?
1746
-------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)