Skip to content

Commit ab9e222

Browse files
DOCSP-16447 localhost connection (#741)
* added information about connecting to localhost
1 parent 2318c84 commit ab9e222

File tree

12 files changed

+59
-4
lines changed

12 files changed

+59
-4
lines changed

source/c.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,13 @@ Connect to MongoDB Atlas
7272
return 0;
7373
}
7474

75-
7675
See `Advanced Connections <http://mongoc.org/libmongoc/current/advanced-connections.html>`__
7776
for more ways to connect.
7877

78+
Connect to ``localhost``
79+
------------------------
80+
81+
.. include:: /includes/localhost-connection.rst
7982

8083
Compatibility
8184
-------------

source/csharp.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,13 @@ Connect to MongoDB Atlas
6565
);
6666
var database = client.GetDatabase("test");
6767

68-
6968
See `Connecting <https://mongodb.github.io/mongo-csharp-driver/2.12/reference/driver/connecting/>`__
7069
for more information.
7170

71+
Connect to ``localhost``
72+
------------------------
73+
74+
.. include:: /includes/localhost-connection.rst
7275

7376
Compatibility
7477
-------------

source/cxx.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ Installation
3636

3737
See `Installing the mongocxx driver <http://mongocxx.org/mongocxx-v3/installation/>`__.
3838

39-
4039
Connect to MongoDB Atlas
4140
------------------------
4241

@@ -57,7 +56,10 @@ Connect to MongoDB Atlas
5756
};
5857
mongocxx::database db = conn["test"];
5958

59+
Connect to ``localhost``
60+
------------------------
6061

62+
.. include:: /includes/localhost-connection.rst
6163

6264
Compatibility
6365
-------------

source/go.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ Connect to MongoDB Atlas
5656
See `Usage <https://github.com/mongodb/mongo-go-driver#usage>`__
5757
for more detail.
5858

59+
Connect to ``localhost``
60+
------------------------
61+
62+
.. include:: /includes/localhost-connection.rst
63+
5964
Compatibility
6065
-------------
6166

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
To connect to a database running locally on its default port, change the
2+
connection string to ``"mongodb://localhost"``.
3+
4+
To connect to a database running locally, change the connection string
5+
to ``"mongodb://localhost:<port>"``.
6+
7+
Your ``mongod`` instance must be running to successfully connect to your
8+
database. For information on how to start your ``mongod`` instance,
9+
see the :manual:`Manage mongod Processes
10+
</tutorial/manage-mongodb-processes/#start-mongod-processes>` Server Manual Entry.

source/motor.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,11 @@ If the connection fails, you should see the following message:
129129
For more information on the connection string, see the MongoDB Server
130130
Manual entry on :manual:`Connection String URI Format </reference/connection-string/>`.
131131

132+
Connect to ``localhost``
133+
------------------------
134+
135+
.. include:: /includes/localhost-connection.rst
136+
132137
Compatibility
133138
-------------
134139

source/php.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ Connect to MongoDB Atlas
111111

112112
$db = $client->test;
113113

114+
Connect to ``localhost``
115+
------------------------
116+
117+
.. include:: /includes/localhost-connection.rst
114118

115119
Compatibility
116120
-------------

source/pymongo.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ If the connection fails, you should see the following message:
9999
For more information on the connection string, see the MongoDB Server
100100
Manual entry on :manual:`Connection String URI Format </reference/connection-string/>`.
101101

102+
Connect to ``localhost``
103+
------------------------
104+
105+
.. include:: /includes/localhost-connection.rst
106+
102107
Compatibility
103108
-------------
104109

source/reactive-streams.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ Connect to MongoDB Atlas
6363
See :java-docs:`Connect to MongoDB <driver-reactive/tutorials/connect-to-mongodb/>`
6464
for more ways to connect.
6565

66+
Connect to ``localhost``
67+
------------------------
68+
69+
.. include:: /includes/localhost-connection.rst
70+
6671
Compatibility
6772
-------------
6873

source/rust.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ corresponding connection code samples.
112112
Ok(())
113113
}
114114

115+
Connect to ``localhost``
116+
------------------------
117+
118+
.. include:: /includes/localhost-connection.rst
119+
115120
Compatibility
116121
-------------
117122

0 commit comments

Comments
 (0)