Skip to content

Commit 93f4f7a

Browse files
authored
rename and clean up constants (#35)
1 parent 02361e6 commit 93f4f7a

File tree

11 files changed

+46
-50
lines changed

11 files changed

+46
-50
lines changed

snooty.toml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ intersphinx = [
1313

1414
[constants]
1515
docs-branch = "master" # always set this to the docs branch (i.e. master, 1.7, 1.8, etc.)
16-
driver-branch = "v1.7.0" # always set this to the driver branch (i.e. 1.7.0, 1.8.0, etc.)
17-
raw-github = "https://raw.githubusercontent.com/mongodb/docs-golang/{+docs-branch+}/source/includes"
16+
version = "v1.7.0" # always set this to the driver branch (i.e. v1.7.0, v1.8.0, etc.)
1817
example = "https://raw.githubusercontent.com/mongodb/docs-golang/{+docs-branch+}/source/includes/usage-examples/code-snippets"
19-
godocs = "https://pkg.go.dev/go.mongodb.org/mongo-driver@{+driver-branch+}"
20-
version = 4.0
21-
package-name-org = "mongodb-org"
22-
pgp-version = "{+version+}"
18+
api = "https://pkg.go.dev/go.mongodb.org/mongo-driver@{+version+}"

source/fundamentals/crud/write-operations/change-a-document.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,18 @@ A Note About ``_id``
5656
Each document in a MongoDB collection has a unique and immutable ``_id``
5757
field. You cannot use update and replace operations to change the
5858
``_id`` field. If you attempt to change this field, the update and
59-
replace methods return a `WriteError <{+godocs+}/mongo#WriteError>`__.
59+
replace methods return a `WriteError <{+api+}/mongo#WriteError>`__.
6060

6161
.. _updateDocuments:
6262

6363
Update
6464
------
6565

66-
Use either `UpdateOne() <{+godocs+}/mongo#Collection.UpdateOne>`__ or
67-
`UpdateByID() <{+godocs+}/mongo#Collection.UpdateByID>`__ to update a
66+
Use either `UpdateOne() <{+api+}/mongo#Collection.UpdateOne>`__ or
67+
`UpdateByID() <{+api+}/mongo#Collection.UpdateByID>`__ to update a
6868
single document.
6969

70-
Use `UpdateMany() <{+godocs+}/mongo#Collection.UpdateMany>`__ to update
70+
Use `UpdateMany() <{+api+}/mongo#Collection.UpdateMany>`__ to update
7171
multiple documents.
7272

7373

@@ -101,7 +101,7 @@ Return Values
101101
~~~~~~~~~~~~~
102102

103103
``UpdateOne()``, ``UpdateByID()``, and ``UpdateMany()`` return an
104-
`UpdateResult <{+godocs+}/mongo#UpdateResult>`__ type that
104+
`UpdateResult <{+api+}/mongo#UpdateResult>`__ type that
105105
contains information about the update operation if the operation is
106106
successful. The ``UpdateResult`` type contains the following properties:
107107

@@ -178,7 +178,7 @@ The following shows the updated document resulting from the preceding update ope
178178
Replace
179179
-------
180180

181-
Use the `ReplaceOne() <{+godocs+}/mongo#Collection.ReplaceOne>`__ method
181+
Use the `ReplaceOne() <{+api+}/mongo#Collection.ReplaceOne>`__ method
182182
to replace a single document.
183183

184184
Parameters
@@ -195,7 +195,7 @@ documents use the following format:
195195
Return Values
196196
~~~~~~~~~~~~~
197197

198-
``ReplaceOne()`` returns an `UpdateResult <{+godocs+}/mongo#UpdateResult>`__ type that
198+
``ReplaceOne()`` returns an `UpdateResult <{+api+}/mongo#UpdateResult>`__ type that
199199
contains information about the replace operation if the operation is
200200
successful. The ``UpdateResult`` type contains the following properties:
201201

source/usage-examples/bulkWrite.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Perform Bulk Operations
55
.. default-domain:: mongodb
66

77
You can perform bulk write operations on a collection using the
8-
``BulkWrite()`` method.
8+
``BulkWrite()`` method.
99

1010
The following example specifies a slice of ``WriteModels`` and an option
1111
to the ``BulkWrite()`` method, which performs the following in order:
@@ -28,12 +28,12 @@ Expected Result
2828
---------------
2929

3030
After you run the preceding code snippet, you should be able to find the
31-
document in the ``haikus`` collection:
31+
document in the ``haikus`` collection:
3232

3333
.. code-block:: json
3434
:copyable: false
3535

36-
{
36+
{
3737
"_id" : ObjectId("..."),
3838
"title" : "Dodge The Greys",
3939
"text" : "When there're no matches, no longer need to panic. You can use upsert."
@@ -47,14 +47,14 @@ Additional Information
4747

4848
For more information on performing bulk write operations on a collection
4949
and handling potential errors, see our guide on <TODO: Bulk Write
50-
Fundamentals>.
50+
Fundamentals>.
5151

5252
For more information, see our :manual:`Bulk Write Operations
5353
</core/bulk-write-operations/>` page.
5454

5555
API Documentation
5656
~~~~~~~~~~~~~~~~~
5757

58-
- `BulkWrite() <{+godocs+}/mongo#Collection.BulkWrite>`__
59-
- `NewUpdateOneModel() <{+godocs+}/mongo#NewUpdateOneModel>`__
60-
- `NewReplaceOneModel() <{+godocs+}/mongo#NewReplaceOneModel>`__
58+
- `BulkWrite() <{+api+}/mongo#Collection.BulkWrite>`__
59+
- `NewUpdateOneModel() <{+api+}/mongo#NewUpdateOneModel>`__
60+
- `NewReplaceOneModel() <{+api+}/mongo#NewReplaceOneModel>`__

source/usage-examples/command.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ You can run commands directly on your MongoDB server using the
99

1010
The following example passes a document containing the ``"dbStats"``
1111
command to the ``RunCommand()`` method, which retrieves statistics
12-
about the ``sample_restaurants`` database:
12+
about the ``sample_restaurants`` database:
1313

1414
.. include:: /includes/usage-examples/run-example-tip.rst
1515

@@ -31,12 +31,12 @@ values:
3131
.. code-block:: json
3232

3333
// results truncated
34-
[ {db sample_restaurants}
35-
{collections 2}
36-
{views 0}
37-
{objects 25554}
38-
{avgObjSize 548.4101901854896}
39-
{dataSize 14014074} {storageSize 8257536}
34+
[ {db sample_restaurants}
35+
{collections 2}
36+
{views 0}
37+
{objects 25554}
38+
{avgObjSize 548.4101901854896}
39+
{dataSize 14014074} {storageSize 8257536}
4040
... ]
4141

4242
.. note::
@@ -48,9 +48,9 @@ Additional Information
4848
----------------------
4949

5050
For more information on running a command, see our guide on
51-
<TODO: Run a Command>.
51+
<TODO: Run a Command>.
5252

5353
API Documentation
5454
~~~~~~~~~~~~~~~~~
5555

56-
`RunCommand() <{+godocs+}/mongo#Database.RunCommand>`__
56+
`RunCommand() <{+api+}/mongo#Database.RunCommand>`__

source/usage-examples/count.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Expected Result
3131

3232
After running the preceding code snippet, you should see the following:
3333

34-
- There are about ``23541`` documents in the ``movies`` collection
34+
- There are about ``23541`` documents in the ``movies`` collection
3535
- There are ``303`` documents in the ``movies`` collection from "China"
3636

3737
.. note::
@@ -42,10 +42,10 @@ Additional Information
4242
----------------------
4343

4444
For more information on counting documents, see our guide on
45-
<TODO: Counting Documents>.
45+
<TODO: Counting Documents>.
4646

4747
API Documentation
4848
~~~~~~~~~~~~~~~~~
4949

50-
- `CountDocuments() <{+godocs+}/mongo#Collection.CountDocuments>`__
51-
- `EstimatedDocumentCount() <{+godocs+}/mongo#Collection.EstimatedDocumentCount>`__
50+
- `CountDocuments() <{+api+}/mongo#Collection.CountDocuments>`__
51+
- `EstimatedDocumentCount() <{+api+}/mongo#Collection.EstimatedDocumentCount>`__

source/usage-examples/distinct.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ Retrieve Distinct Values of a Field
55
.. default-domain:: mongodb
66

77
You can retrieve a list of distinct values for a field across a
8-
collection by using the ``Distinct()`` method.
8+
collection by using the ``Distinct()`` method.
99

1010
The following example specifies a query filter and a field name to the
1111
``Distinct()`` method, which matches documents in the ``movies``
1212
collection where the ``directors`` field contains "Natalie Portman" and
13-
returns distinct values of the ``title`` field from the matched documents.
13+
returns distinct values of the ``title`` field from the matched documents.
1414

1515
.. include:: /includes/usage-examples/run-example-tip.rst
1616

@@ -27,7 +27,7 @@ Expected Result
2727
---------------
2828

2929
The example returns an empty slice of an ``interface`` type that
30-
contains the following values:
30+
contains the following values:
3131

3232
.. code-block:: none
3333
:copyable: false
@@ -39,9 +39,9 @@ Additional Information
3939
----------------------
4040

4141
For more information on retrieving distinct values, see our guide on
42-
<TODO: Distinct Fundamentals>.
42+
<TODO: Distinct Fundamentals>.
4343

4444
API Documentation
4545
~~~~~~~~~~~~~~~~~
4646

47-
`Distinct() <{+godocs+}/mongo#Collection.Distinct>`__
47+
`Distinct() <{+api+}/mongo#Collection.Distinct>`__

source/usage-examples/findOne.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ see the :manual:`MongoDB query operator reference documentation
5151
API Documentation
5252
~~~~~~~~~~~~~~~~~
5353

54-
`FindOne() <{+godocs+}/mongo#Collection.FindOne>`__
54+
`FindOne() <{+api+}/mongo#Collection.FindOne>`__

source/usage-examples/insertMany.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ For more information on inserting documents, see our guide on
5656
API Documentation
5757
~~~~~~~~~~~~~~~~~
5858

59-
`InsertMany() <{+godocs+}/mongo#Collection.InsertMany>`__
59+
`InsertMany() <{+api+}/mongo#Collection.InsertMany>`__

source/usage-examples/insertOne.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ For more information on inserting documents, see our guide on
5151
API Documentation
5252
~~~~~~~~~~~~~~~~~
5353

54-
`InsertOne() <{+godocs+}/mongo#Collection.InsertOne>`__
54+
`InsertOne() <{+api+}/mongo#Collection.InsertOne>`__

source/usage-examples/replaceOne.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ Replace a Document
55
.. default-domain:: mongodb
66

77
You can replace a document in a collection by using the ``ReplaceOne()``
8-
method.
8+
method.
99

1010
The following example specifies a query filter and replacement document
1111
to the ``ReplaceOne()`` method, which matches a document in the
1212
``haikus`` collection where the ``title`` field is "Record of a
1313
Shriveled Datum" and replaces it with a document that contains a
14-
``title`` and ``text`` field about a haiku:
14+
``title`` and ``text`` field about a haiku:
1515

1616
.. include:: /includes/usage-examples/run-example-tip.rst
1717

@@ -28,12 +28,12 @@ Expected Result
2828
---------------
2929

3030
After you run the preceding code snippet, you should be able to find the
31-
replacement document in the ``haikus`` collection:
31+
replacement document in the ``haikus`` collection:
3232

3333
.. code-block:: json
3434
:copyable: false
3535

36-
{
36+
{
3737
"_id" : ObjectId("..."),
3838
"title" : "Dodging Greys",
3939
"text" : "When there're no matches, no longer need to panic. You can use upsert."
@@ -52,4 +52,4 @@ fundamental page>**.
5252
API Documentation
5353
~~~~~~~~~~~~~~~~~
5454

55-
`ReplaceOne() <{+godocs+}/mongo#Collection.ReplaceOne>`__
55+
`ReplaceOne() <{+api+}/mongo#Collection.ReplaceOne>`__

0 commit comments

Comments
 (0)