Skip to content

Commit 136760f

Browse files
committed
Docs Site: Consistent use of apiref and backticks around the class/method names for the text of those references.
1 parent 40759d9 commit 136760f

File tree

9 files changed

+76
-63
lines changed

9 files changed

+76
-63
lines changed

docs/reference/content/getting-started/quick-tour-admin.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,11 @@ collection.insertOne(new Document("_id", 1).append("content", "additional conten
136136
collection.insertOne(new Document("_id", 2).append("content", "irrelevant content"));
137137

138138
// Find using the text index
139-
long matchCount = collection.count(text("textual content -irrelevant"));
139+
long matchCount = collection.count(Filters.text("textual content -irrelevant"));
140140
System.out.println("Text search matches: " + matchCount);
141141

142142
// Find using the $language operator
143-
Bson textSearch = text("textual content -irrelevant", "english");
143+
Bson textSearch = Filters.text("textual content -irrelevant", "english");
144144
matchCount = collection.count(textSearch);
145145
System.out.println("Text search matches (english): " + matchCount);
146146

@@ -161,4 +161,7 @@ Highest scoring document: { "_id" : 1, "content" : "additional content", "score"
161161
For more information about text search see the [text index]({{< docsref "/core/index-text" >}}) and
162162
[$text query operator]({{< docsref "/reference/operator/query/text">}}) documentation.
163163

164-
That concludes the admin quick tour overview! Remember any [command]({{< docsref "/reference/command">}}) that doesn't have a specific helper can be called by the [database.runCommand()](http://api.mongodb.org/java/3.0/?com/mongodb/async/client/MongoDatabase.html#runCommand-org.bson.conversions.Bson-com.mongodb.ReadPreference-com.mongodb.async.SingleResultCallback-).
164+
That concludes the admin quick tour overview! Remember any [command]({{< docsref "/reference/command">}}) that doesn't have a specific
165+
helper can be called by the
166+
[`runCommand()`]({{< apiref "com/mongodb/client/MongoDatabase.html#runCommand-org.bson.conversions.Bson-">}}) method on
167+
`MongoDatabase`.

docs/reference/content/getting-started/quick-tour.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ When creating many `MongoClient` instances:
7272
## Get a Collection
7373

7474
To get a collection to operate upon, specify the name of the collection to
75-
the [getCollection(String collectionName)]({{< apiref "com/mongodb/client/MongoDatabase.html#getCollection-java.lang.String-">}})
75+
the [`getCollection()`]({{< apiref "com/mongodb/client/MongoDatabase.html#getCollection-java.lang.String-">}})
7676
method:
7777

7878
The following example gets the collection `test`. If the collection does not
@@ -104,7 +104,7 @@ contains a field `info` which is an embedded document:
104104
```
105105

106106
To create the document using the Java driver, use the
107-
[Document]({{< apiref "org/bson/Document.html">}}) class. You
107+
[`Document`]({{< apiref "org/bson/Document.html">}}) class. You
108108
can use this class to create the embedded document as well.
109109

110110
```java
@@ -152,7 +152,7 @@ collection.insertMany(documents);
152152

153153
Now that we've inserted 101 documents (the 100 we did in the loop, plus
154154
the first one), we can check to see if we have them all using the
155-
[count()]({{< apiref "com/mongodb/client/MongoCollection#count--">}})
155+
[`count()`]({{< apiref "com/mongodb/client/MongoCollection#count--">}})
156156
method. The following code should print `101`.
157157

158158
```java
@@ -162,16 +162,16 @@ System.out.println(collection.count());
162162
## Query the Collection
163163

164164
Use the
165-
[find()]({{< apiref "com/mongodb/client/MongoCollection.html#find--">}})
165+
[`find()`]({{< apiref "com/mongodb/client/MongoCollection.html#find--">}})
166166
method to query the collection.
167167

168168
### Find the First Document in a Collection
169169

170170
call the first() method on the result of the find() of method
171171

172172
To get the first document in the collection, call the
173-
[first()]({{< apiref "com/mongodb/client/MongoIterable.html#first--">}})
174-
method on the [find()]({{< apiref "com/mongodb/client/MongoCollection.html#find--">}})
173+
[`first()`]({{< apiref "com/mongodb/client/MongoIterable.html#first--">}})
174+
method on the [`find()`]({{< apiref "com/mongodb/client/MongoCollection.html#find--">}})
175175
operation. `collection.find().first()` returns the first document or null rather than a cursor.
176176
This is useful for queries that should only match a single document, or if you are
177177
interested in the first document only.
@@ -250,7 +250,8 @@ and it should just print just one document
250250

251251

252252
{{% note %}}
253-
Use the [Filters]({{< apiref "com/mongodb/client/model/Filters">}}), [Sorts]({{< apiref "com/mongodb/client/model/Sorts">}}) and [Projections]({{< apiref "com/mongodb/client/model/Projections">}})
253+
Use the [`Filters`]({{< apiref "com/mongodb/client/model/Filters">}}), [`Sorts`]({{< apiref "com/mongodb/client/model/Sorts">}}) and
254+
[`Projections`]({{< apiref "com/mongodb/client/model/Projections">}})
254255
helpers for simple and concise ways of building up queries.
255256
{{% /note %}}
256257

@@ -282,8 +283,9 @@ collection.find(and(gt("i", 50), lte("i", 100))).forEach(printBlock);
282283

283284
## Sorting documents
284285

285-
We can also use the [Sorts]({{< apiref "com/mongodb/client/model/Sorts">}}) helpers to sort documents.
286-
We add a sort to a find query by calling the `sort()` method on a `FindIterable`. Below we use the [`exists()`]({{ < apiref "com/mongodb/client/model/Filters.html#exists-java.lang.String-">}}) helper and sort
286+
We can also use the [`Sorts`]({{< apiref "com/mongodb/client/model/Sorts">}}) helpers to sort documents.
287+
We add a sort to a find query by calling the `sort()` method on a `FindIterable`. Below we use the
288+
[`exists()`]({{ < apiref "com/mongodb/client/model/Filters.html#exists-java.lang.String-">}}) helper and sort
287289
[`descending("i")`]({{ < apiref "com/mongodb/client/model/Sorts.html#exists-java.lang.String-">}}) helper to
288290
sort our documents:
289291

@@ -294,7 +296,8 @@ System.out.println(myDoc.toJson());
294296

295297
## Projecting fields
296298

297-
Sometimes we don't need all the data contained in a document, the [Projections]({{< apiref "com/mongodb/client/model/Projections">}}) helpers help build the projection parameter for the
299+
Sometimes we don't need all the data contained in a document, the [`Projections`]({{< apiref "com/mongodb/client/model/Projections">}})
300+
helpers help build the projection parameter for the
298301
find operation. Below we'll sort the collection, exclude the `_id` field and output the first
299302
matching document:
300303

docs/reference/content/reference/bson/documents.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The driver includes several classes and interfaces used for representing BSON do
1313

1414
### BsonDocument
1515

16-
Although generally not needed by users of the high-level driver API, the [BsonDocument]({{< apiref "org/bson/BsonDocument" >}}) class is
16+
Although generally not needed by users of the high-level driver API, the [`BsonDocument`]({{< apiref "org/bson/BsonDocument" >}}) class is
1717
central to the way that documents are managed internally by the driver. The BsonDocument class can represent dynamically structured
1818
documents of any complexity with a type-safe API. For instance, the document `{ a: "MongoDB", b: [ { c: 1 } ] }` can be constructed as a
1919
BsonDocument as follows:
@@ -25,11 +25,11 @@ new BsonDocument().append("a", new BsonString("MongoDB"))
2525

2626
The type safety comes from BsonDocument implementing `Map<String, BsonValue>`, so even built-in types like `int`, `String` and `List` must
2727
be wrapped in a sub-class of `BsonValue`. For a complete list of BsonValue sub-types, please consult the
28-
[API documentation]({{< apiref "org/bson/BsonValue" >}}).
28+
[`BsonValue`]({{< apiref "org/bson/BsonValue" >}}) API documentation.
2929

3030
### Document
3131

32-
Most applications will use the [Document]({{< apiref "org/bson/Document" >}}) class instead. Like BsonDocument, the
32+
Most applications will use the [`Document`]({{< apiref "org/bson/Document" >}}) class instead. Like BsonDocument, the
3333
Document class can represent dynamically structured documents of any complexity; however, the typing is much looser, as Document
3434
implements `Map<String, Object>`. As a result, the same document as above can be constructed using the Document class as follows:
3535

@@ -60,7 +60,7 @@ It is actually possible to change these mappings; the mechanism for doing so is
6060
### DBObject
6161

6262
Although not recommended for new applications, those upgrading from the 2.x driver series may continue to use the
63-
[DBObject]({{< apiref "com/mongodb/DBObject" >}}) interface to represent BSON documents. DBObject is similar to Document in that it
63+
[`DBObject`]({{< apiref "com/mongodb/DBObject" >}}) interface to represent BSON documents. DBObject is similar to Document in that it
6464
represents BSON values as `Object`, but it has a few shortcomings that were impossible to overcome:
6565

6666
- it is an interface rather than a class, so it's API can not be extended without breaking binary compatibility
@@ -70,7 +70,7 @@ that interface, is required
7070

7171
### Bson
7272

73-
To tie these all together, the driver contains a small but powerful interface called [Bson]({{< apiref "org/bson/conversions/Bson" >}}).
73+
To tie these all together, the driver contains a small but powerful interface called [`Bson`]({{< apiref "org/bson/conversions/Bson" >}}).
7474
Any class that represents a BSON document, whether included in the driver itself or from a third party, can implement this interface and
7575
can then be used any place in the high-level API where a BSON document is required. The three classes discussed above all implement this
7676
interface and so can be used interchangeably based on the needs of a given application. For example:

docs/reference/content/reference/bson/extended-json.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ title = "Extended JSON"
99

1010
## MongoDB Extended JSON
1111

12-
The Java driver supports reading and writing JSON-like documents with the [JsonReader]({{< apiref "org/bson/json/JsonReader" >}}) and
13-
[JsonWriter]({{< apiref "org/bson/json/JsonWriter" >}}) classes, which can read/write both flavors of
12+
The Java driver supports reading and writing JSON-like documents with the [`JsonReader`]({{< apiref "org/bson/json/JsonReader" >}}) and
13+
[`JsonWriter`]({{< apiref "org/bson/json/JsonWriter" >}}) classes, which can read/write both flavors of
1414
[MongoDB Extended JSON](http://docs.mongodb.org/manual/reference/mongodb-extended-json/):
1515

16-
- MongoDB Extended JSON Strict Mode: representations of BSON types that conform to the [JSON RFC](http://www.json.org/). This is the
16+
- Strict Mode: representations of BSON types that conform to the [JSON RFC](http://www.json.org/). This is the
1717
format that [mongoexport](http://docs.mongodb.org/manual/reference/program/mongoexport/) produces and
1818
[mongoimport](http://docs.mongodb.org/manual/reference/program/mongoimport/) consumes.
19-
- MongoDB Shell Mode: a superset of JSON that the
19+
- Shell Mode: a superset of JSON that the
2020
[MongoDB shell](http://docs.mongodb.org/manual/tutorial/getting-started-with-the-mongo-shell/) can parse.
2121

2222

docs/reference/content/reference/bson/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ The driver comprehensively supports [BSON](http://www.bsonspec.org), the data st
1313
“documents". BSON, short for Binary [JSON](http://json.org/), is a binary-encoded serialization of JSON-like documents.
1414

1515
- [Documents]({{< relref "documents.md" >}}): Documentation of the driver's support for BSON documents
16-
- [MongoDB Extended JSON]({{< relref "extended-json.md" >}}): Documentation of the driver's support for MongoDB Extended JSON
16+
- [Extended JSON]({{< relref "extended-json.md" >}}): Documentation of the driver's support for MongoDB Extended JSON

docs/reference/content/reference/connecting/authenticating.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,13 @@ The Java driver supports all MongoDB [authentication mechanisms](http://docs.mon
1313
only available in the MongoDB [Enterprise Edition](http://docs.mongodb.org/manual/administration/install-enterprise/).
1414

1515
An authentication credential is represented as an instance of the
16-
[MongoCredential](http://api.mongodb.org/java/current/com/mongodb/MongoCredential.html) class, which includes static factory methods for
16+
[`MongoCredential`]({{< apiref "com/mongodb/MongoCredential" >}}) class, which includes static factory methods for
1717
each of the supported authentication mechanisms. A list of these instances must be passed to the driver via one of several
18-
[MongoClient](http://api.mongodb.org/java/current/com/mongodb/MongoCredential.html) constructors that take a
19-
parameter of type `List<MongoCredential>`.
18+
[`MongoClient`]({{< apiref "com/mongodb/MongoClient" >}}) constructors that take either a
19+
parameter of type `List<MongoCredential>`. Alternatively, a single [`MongoCredential`]({{< apiref "com/mongodb/MongoCredential" >}})
20+
can be created implicity via a
21+
[`MongoClientURI`]({{< apiref "com/mongodb/MongoClientURI" >}}) and passed to a [`MongoClient`]({{< apiref "com/mongodb/MongoClient" >}})
22+
constructor that takes a `[`MongoClientURI`]({{< apiref "com/mongodb/MongoClientURI" >}}) parameter.
2023

2124
{{% note %}}
2225
Given the flexibility of role-based access control in MongoDB, it is usually sufficient to authenticate with a single user, but, for completeness, the driver accepts a list of credentials.

docs/reference/content/reference/connecting/index.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,14 @@ mongodb://host:27017/mydb
4444
Above, the database by the name of "mydb" is where the credentials are stored for the application.
4545

4646
{{% note %}}
47-
Some drivers utilize the database component to indicate which database to work with by default. The Java driver, while it parses the database component, does not use the database component for anything other than authentication.
47+
Some drivers utilize the database component to indicate which database to work with by default. The Java driver, while it parses the
48+
database component, does not use the database component for anything other than authentication.
4849
{{% /note %}}
4950

5051
#### Options
5152

52-
Many options can be provided via the connection string. The ones that cannot may be provided in a `MongoClientOptions` instance. To
53+
Many options can be provided via the connection string. The ones that cannot may be provided in a
54+
[`MongoClientOptions`]({{< apiref "com/mongodb/MongoClientOptions" >}}) instance. To
5355
provide an option, append a `?` to the connection string and separate options by an `&`.
5456

5557
```ini
@@ -58,15 +60,14 @@ mongodb://host:27017/?replicaSet=rs0&maxPoolSize=200
5860

5961
The above connection string sets the "replicaSet" value to "rs0" and the "maxPoolSize" to "200".
6062

61-
For a comprehensive list of the available options, see the [MongoClientURI](http://api.mongodb.org/java/3.0/com/mongodb/MongoClientURI.html)
62-
documentation.
63+
For a comprehensive list of the available options, see the [`MongoClientURI`]({{< apiref "com/mongodb/MongoClientURI" >}}) documentation.
6364

6465

6566
### MongoClient
6667

67-
A `MongoClient` instance will be the root object for all interaction with MongoDB. It is all that is needed to handle connecting to
68-
servers, monitoring servers, and performing operations against those servers. Without any arguments, constructing a `MongoClient`
69-
instance will connect to "localhost" port 27017.
68+
A [`MongoClient`]({{< apiref "com/mongodb/MongoClient" >}}) instance will be the root object for all interaction with MongoDB. It is all
69+
that is needed to handle connecting to servers, monitoring servers, and performing operations against those servers. Without any
70+
arguments, constructing a [`MongoClient`]({{< apiref "com/mongodb/MongoClient" >}}) instance will connect to "localhost" port 27017.
7071

7172
```java
7273
MongoClient client = new MongoClient();
@@ -78,16 +79,17 @@ Alternatively, a connection string may be provided:
7879
MongoClient client = new MongoClient(new MongoClientURI("mongodb://host:27017,host2:27017/?replicaSet=rs0"));
7980
```
8081

81-
Finally, the `MongoClientOptions` class provides an in-code way to set the same options from a connection string. This is sometimes
82+
Finally, the [`MongoClientOptions`]({{< apiref "com/mongodb/MongoClientOptions" >}}) class provides an in-code way to set the same options from a connection string. This is sometimes
8283
necessary, as the connection string does not allow an application to configure as many configuration options as `MongoClientOptions`.
83-
`MongoClientOptions` instances are immutable, so to create one your application uses a builder:
84+
[`MongoClientOptions`]({{< apiref "com/mongodb/MongoClientOptions" >}}) instances are immutable, so to create one your application uses a builder:
8485

8586
```java
8687
MongoClientOptions options = MongoClientOptions.builder().cursorFinalizerEnabled(false).build();
8788
MongoClient client = new MongoClient(options);
8889
```
8990

90-
It's also possible to combine `MongoClientOptions` with `MongoClientURI`, for situations where your application needs to set some options
91+
It's also possible to combine [`MongoClientOptions`]({{< apiref "com/mongodb/MongoClientOptions" >}}) with
92+
[`MongoClientURI`]({{< apiref "com/mongodb/MongoClientURI" >}}), for situations where your application needs to set some options
9193
in code but others via the connection string:
9294

9395
```java

docs/reference/content/whats-new/index.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ title = "What's New"
1010

1111
Key features of the 3.0 driver include:
1212

13-
- A generic [MongoCollection](http://api.mongodb.org/java/3.0/com/mongodb/client/MongoCollection.html) interface that complies with a new cross-driver [CRUD specification](https://github.com/mongodb/specifications/blob/master/source/crud/crud.rst).
13+
- A generic [`MongoCollection`]({{< apiref "com/mongodb/client/MongoCollection" >}}) interface that complies with a new cross-driver
14+
[CRUD specification](https://github.com/mongodb/specifications/blob/master/source/crud/crud.rst).
1415
- A new [asynchronous API](https://github.com/mongodb/mongo-java-driver/tree/master/driver-async) that can leverage either
1516
[Netty](http://netty.io/) or Java 7's
1617
[AsynchronousSocketChannel](http://docs.oracle .com/javase/7/docs/api/java/nio/channels/AsynchronousSocketChannel.html)
17-
- A new [Codec](http://api.mongodb.org/java/3.0/org/bson/codecs/Codec.html) infrastructure that you can use to build high-performance
18+
- A new [`Codec`]({{< apiref "org/bson/codecs/Codec" >}}) infrastructure that you can use to build high-performance
1819
encoders and decoders without requiring an intermediate Map instance.
1920
- A new core driver on top of which you can build alternative or experimental driver APIs
2021

0 commit comments

Comments
 (0)