Skip to content

Commit 41f6973

Browse files
authored
DOCSP-5402 DOCSP-4584 Apply template to Go driver landing page (#499)
* DOCSP-5402 DOCSP-4584 Apply template to Go driver landing page This also adds a connection example for Atlas. * DOCSP-4584 Extract go driver compatibility to tables
1 parent 468ed75 commit 41f6973

File tree

4 files changed

+101
-41
lines changed

4 files changed

+101
-41
lines changed

source/drivers/driver-compatibility-reference.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,25 @@ Language Compatibility
264264
-
265265
-
266266

267+
.. _reference-compatibility-go:
268+
269+
Go Driver Compatibility
270+
-----------------------
271+
272+
.. _reference-compatibility-mongodb-go:
273+
274+
MongoDB Compatibility
275+
~~~~~~~~~~~~~~~~~~~~~
276+
277+
.. include:: /includes/mongodb-compatibility-table-go.rst
278+
279+
.. _reference-compatibility-language-go:
280+
281+
Language Compatibility
282+
~~~~~~~~~~~~~~~~~~~~~~
283+
284+
.. include:: /includes/language-compatibility-table-go.rst
285+
267286
.. _reference-compatibility-java:
268287

269288
Java Driver Compatibility

source/drivers/go.txt

Lines changed: 61 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
========================
1+
.. include:: /includes/unicode-checkmark.rst
2+
3+
=================
24
MongoDB Go Driver
3-
========================
5+
=================
46

57
.. default-domain:: mongodb
68

@@ -10,58 +12,76 @@ MongoDB Go Driver
1012
:depth: 1
1113
:class: twocols
1214

13-
The official Go Driver is available on `github <https://github.com/mongodb/mongo-go-driver/>`_. See the `README <https://github.com/mongodb/mongo-go-driver/blob/master/README.md>`_ for more details on installation and bugs/feature reporting.
15+
Introduction
16+
------------
1417

15-
MongoDB Go Driver Compatibility
16-
---------------------------------
18+
This is the official MongoDB Go Driver.
1719

18-
.. list-table::
19-
:header-rows: 1
20-
:stub-columns: 1
21-
:class: compatibility-large
20+
- `General documentation for the MongoDB Go Driver <https://godoc.org/github.com/mongodb/mongo-go-driver/mongo>`__
2221

23-
* - Go Driver
24-
- MongoDB 4.0
25-
- MongoDB 3.6
26-
- MongoDB 3.4
27-
- MongoDB 3.2
28-
- MongoDB 3.0
29-
- MongoDB 2.6
22+
- `Get Started with Go <https://www.mongodb.com/blog/post/mongodb-go-driver-tutorial>`_
3023

31-
* - 1.0.0
32-
- |checkmark|
33-
- |checkmark|
34-
- |checkmark|
35-
- |checkmark|
36-
- |checkmark|
37-
- |checkmark|
24+
- `Migration from Community Drivers <https://www.mongodb.com/blog/post/go-migration-guide>`_
3825

26+
- `Changelog <https://github.com/mongodb/mongo-go-driver/releases>`__
3927

40-
Language Compatibility
41-
~~~~~~~~~~~~~~~~~~~~~~
28+
- `Source Code <https://github.com/mongodb/mongo-go-driver>`__
4229

43-
The MongoDB Go driver requires Go 1.10 or later.
4430

45-
.. include:: /includes/unicode-checkmark.rst
31+
Installation
32+
------------
33+
34+
The recommended way to get started using the MongoDB Go driver is by using ``dep``
35+
to install the dependency in your project:
36+
37+
.. code-block:: go
38+
39+
dep ensure -add "go.mongodb.org/mongo-driver/mongo@~1.0.0"
40+
41+
42+
See `Installation <https://github.com/mongodb/mongo-go-driver#installation>`__
43+
44+
45+
Connect to MongoDB Atlas
46+
------------------------
4647

47-
Go Driver Documentation
48-
-----------------------
48+
To connect to a `MongoDB Atlas <https://docs.atlas.mongodb.com/>`_ cluster, use the `Atlas connection string <https://docs.atlas.mongodb.com/driver-connection>`__ for your cluster:
4949

50-
On the GoDoc site:
51-
- `General documentation for the MongoDB Go Driver <https://godoc.org/github.com/mongodb/mongo-go-driver/mongo>`_
52-
- `BSON library documentation <https://godoc.org/github.com/mongodb/mongo-go-driver/bson>`_
53-
54-
MongoDB Blog Posts:
55-
- `Get Started With Go <https://www.mongodb.com/blog/post/mongodb-go-driver-tutorial>`_
56-
- `Migration From Community Drivers <https://www.mongodb.com/blog/post/go-migration-guide>`_
50+
.. code-block:: go
5751

58-
Go Driver Community
59-
-------------------
52+
import "go.mongodb.org/mongo-driver/mongo"
6053

61-
Questions can be asked through the `mongo-go-driver Google Group <https://groups.google.com/forum/#!forum/mongodb-go-driver>`_
54+
ctx, _ := context.WithTimeout(context.Background(), 10*time.Second)
55+
client, err := mongo.Connect(ctx, options.Client().ApplyURI(
56+
"mongodb+srv://<username>:<password>@<cluster-address>/test"
57+
))
58+
if err != nil { log.Fatal(err) }
6259

63-
Bug Reporting
60+
See `Usage <https://github.com/mongodb/mongo-go-driver#usage>`__
61+
for more detail.
62+
63+
64+
Compatibility
6465
-------------
6566

66-
New Features and bugs can be reported on `jira <https://jira.mongodb.org/browse/GODRIVER>`_
67+
MongoDB Compatibility
68+
~~~~~~~~~~~~~~~~~~~~~
69+
70+
.. include:: /includes/mongodb-compatibility-table-go.rst
71+
72+
Language Compatibility
73+
~~~~~~~~~~~~~~~~~~~~~~
74+
75+
.. include:: /includes/language-compatibility-table-go.rst
76+
77+
How to get help
78+
---------------
79+
80+
- Join our `Google Group <https://groups.google.com/forum/#!forum/mongodb-go-driver>`__.
81+
- Ask on `Stack Overflow <https://stackoverflow.com/questions/tagged/mongo-go>`__.
82+
- Visit our `Support Channels <https://docs.mongodb.com/manual/support/>`__.
83+
- See the `project JIRA <https://jira.mongodb.org/browse/GODRIVER>`__ to raise issues or request features.
84+
85+
86+
6787

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The MongoDB Go driver requires Go 1.10 or later.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.. list-table::
2+
:header-rows: 1
3+
:stub-columns: 1
4+
:class: compatibility-large
5+
6+
* - Go Driver
7+
- MongoDB 4.0
8+
- MongoDB 3.6
9+
- MongoDB 3.4
10+
- MongoDB 3.2
11+
- MongoDB 3.0
12+
- MongoDB 2.6
13+
14+
* - 1.0.0
15+
- |checkmark|
16+
- |checkmark|
17+
- |checkmark|
18+
- |checkmark|
19+
- |checkmark|
20+
- |checkmark|

0 commit comments

Comments
 (0)