Skip to content

Commit e85259f

Browse files
committed
Docs: Updated to scala 2.12 style apiref links
1 parent b8bbf90 commit e85259f

File tree

20 files changed

+117
-117
lines changed

20 files changed

+117
-117
lines changed

docs/reference/content/bson/documents.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The scala `Document` classes implement `TraversableLike[(String, BsonValue)]` an
2020
However, unlike `Map` implementations of `TraversableLike` enables strict type safety as there is no variance in the value type.
2121
{{% /note %}}
2222

23-
[`BsonValue`]({{< apiref "org.mongodb.scala.bson.BsonValue" >}}) is the type safe representation of a Bson type from the `org.bson` library, it represents specific value types. The most commonly used value types are:
23+
[`BsonValue`]({{< apiref "org/mongodb/scala/bson/index" >}}) is the type safe representation of a Bson type from the `org.bson` library, it represents specific value types. The most commonly used value types are:
2424

2525
| BSON type | Scala type |
2626
|-----------|-----------------------------------|
@@ -75,8 +75,8 @@ doc1 ++= Document("AR" -> BsonString("Arkansas"),
7575

7676
For many of the `BsonValue` types there are obvious direct mappings from a Scala type. For example, a `String` maps to `BsonString`, an `Int`
7777
maps to `BsonInt32` and a `Long` maps to a `BsonInt64`. For convenience these types can be used directly with `Documents` and they are
78-
converted by the contract traits in the [`BsonMagnets`]({{< apiref "org.mongodb.scala.bson.BsonMagnets$" >}}) object. As long as there is
79-
an implicit [`BsonTransformer`]({{< apiref "org.mongodb.scala.bson.BsonTransformer" >}}) in scope for any given type, then that type can be
78+
converted by the contract traits in the [`BsonMagnets`]({{< apiref "org/mongodb/scala/bson/BsonMagnets$" >}}) object. As long as there is
79+
an implicit [`BsonTransformer`]({{< apiref "org/mongodb/scala/bson/BsonTransformer" >}}) in scope for any given type, then that type can be
8080
converted into a `BsonValue`.
8181

8282
The following `BsonTransformers` are in scope by default:
@@ -122,9 +122,9 @@ Source: [The Magnet Pattern](http://spray.io/blog/2012-12-13-the-magnet-pattern/
122122

123123
In the API where we would normally expect a single value or a key value pair or many key value pairs eg: (`BsonValue`, `(String, BsonValue)`
124124
or `Iterable[(String, BsonValue)]`) we require anything that can become those types via _"`CanBeX`"_ traits that handle the implicit
125-
conversions necessary to conform to the correct types. These traits are [`CanBeBsonValue`]({{< apiref "org.mongodb.scala.bson.BsonMagnets$$CanBeBsonValue" >}}),
126-
[`CanBeBsonElement`]({{< apiref "org.mongodb.scala.bson.BsonMagnets$$CanBeBsonElement" >}}) and
127-
[`CanBeBsonElements`]({{< apiref "org.mongodb.scala.bson.BsonMagnets$$CanBeBsonElements" >}}).
125+
conversions necessary to conform to the correct types. These traits are [`CanBeBsonValue`]({{< apiref "org/mongodb/scala/bson/BsonMagnets$$CanBeBsonValue" >}}),
126+
[`CanBeBsonElement`]({{< apiref ""org/mongodb/scala/bson/BsonMagnets$$CanBeBsonElement" >}}) and
127+
[`CanBeBsonElements`]({{< apiref ""org/mongodb/scala/bson/BsonMagnets$$CanBeBsonElements" >}}).
128128

129129
One such example is adding a key value pair to a Document or a list of values:
130130

@@ -135,7 +135,7 @@ val doc2 = Document("codes" -> List("AL", "AK", "AR"))
135135

136136
### Bson
137137

138-
The driver also contains a small but powerful interface called [`Bson`]({{< apiref "org.mongodb.scala.bson.conversions.Bson" >}}). Any class
138+
The driver also contains a small but powerful interface called `Bson`. Any class
139139
that represents a BSON document, whether included in the driver itself or from a third party, can implement this interface and can then
140140
be used any place in the high-level API where a BSON document is required. For example:
141141

docs/reference/content/bson/macros.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ title = "Macros"
1010
## Macros
1111

1212
New in 2.0, the Scala driver allows you to use case classes to represent documents in a collection via the
13-
[`Macros`]({{< apiref "org.mongodb.scala.bson.codecs.Macros" >}}) helper. Simple case classes and nested case classes are supported.
13+
[`Macros`]({{< apiref "org/mongodb/scala/bson/codecs/Macros$" >}}) helper. Simple case classes and nested case classes are supported.
1414
Hierarchical modelling can be achieve by using a sealed trait and having case classes implement the parent trait.
1515

1616
Many simple Scala types are supported and they will be marshaled into their corresponding
17-
[`BsonValue`]({{< apiref "org.mongodb.scala.bson.BsonValue" >}}) type. Below is a list of Scala types and their type-safe BSON representation:
17+
`BsonValue` type. Below is a list of Scala types and their type-safe BSON representation:
1818

1919
| Scala type | BSON type |
2020
|-----------------------------------|-------------------|

docs/reference/content/builders/aggregation.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ title = "Aggregation"
99

1010
## Aggregation
1111

12-
The [`Aggregates`]({{< apiref "org.mongodb.scala.model.Aggregates$" >}}) class provides static factory methods that build [aggregation
12+
The [`Aggregates`]({{< apiref "org/mongodb/scala/model/Aggregates$" >}}) class provides static factory methods that build [aggregation
1313
pipeline operators]({{< docsref "reference/operator/aggregation/" >}}). Each method returns an instance of the
1414
[`Bson`]({{< relref "bson/documents.md#bson" >}}) type, which can in turn be passed to the `aggregate` method of `MongoCollection`.
1515

@@ -25,7 +25,7 @@ All the examples below assume this static import.
2525

2626
The [`$match`]({{< docsref "reference/operator/aggregation/match/" >}}) pipeline stage passes all documents matching the
2727
specified filter to the next stage. Though the filter can be an instance of any class that implements `Bson`, it's convenient to
28-
combine with use of the [`Filters`]({{< apiref "org.mongodb.scala.model.Filters$" >}}) class. In the example below, it's assumed that the
28+
combine with use of the [`Filters`]({{< apiref "org/mongodb/scala/model/Filters$" >}}) class. In the example below, it's assumed that the
2929
`equal` method of the `Filters` class has been statically imported.
3030

3131
This example creates a pipeline stage that matches all documents where the `author` field is equal to `"Dave"`:
@@ -46,7 +46,7 @@ filter(equal("author", "Dave"))
4646

4747
The [`$project`]({{< docsref "reference/operator/aggregation/project/" >}}) pipeline stage passes the projected fields of all
4848
documents to the next stage. Though the projection can be an instance of any class that implements `Bson`, it's convenient to combine
49-
with use of the [`Projections`]({{< apiref "org.mongodb.scala.model.Projections$" >}}) class. In the example below, it's assumed that the
49+
with use of the [`Projections`]({{< apiref "org/mongodb/scala/model/Projections$" >}}) class. In the example below, it's assumed that the
5050
`include`, `excludeId`, and `fields` methods of the `Projections` class have been statically imported.
5151

5252
This example creates a pipeline stage that excludes the `_id` field but includes the `title` and `author` fields:
@@ -77,7 +77,7 @@ sample(5)
7777

7878
The [`$sort`]({{< docsref "reference/operator/aggregation/sort/" >}}) pipeline stage passes all documents to the next stage,
7979
sorted by the specified sort criteria. Though the sort criteria can be an instance of any class that implements `Bson`, it's convenient to
80-
combine with use of the [`Sorts`]({{< apiref "org.mongodb.scala.model.Sorts$" >}}) class. In the example below, it's assumed that the
80+
combine with use of the [`Sorts`]({{< apiref "org/mongodb/scala/model/Sorts$" >}}) class. In the example below, it's assumed that the
8181
`descending`, `ascending`, and `orderBy` methods of the `Sorts` class have been statically imported.
8282

8383
This example creates a pipeline stage that sorts in descending order according to the value of the `age` field and then in ascending order
@@ -128,7 +128,7 @@ expression and outputs to the next stage a document for each distinct grouping.
128128
expression on which to group, and zero or more
129129
[accumulators]({{< docsref "reference/operator/aggregation/group/#accumulator-operator" >}}) which are evaluated for each
130130
grouping. To simplify the expression of accumulators, the driver includes an
131-
[`Accumulators`]({{< apiref "org.mongodb.scala.model.Aggregates$" >}}) class with static factory methods for each of the supported
131+
[`Accumulators`]({{< apiref "org/mongodb/scala/model/Aggregates$" >}}) class with static factory methods for each of the supported
132132
accumulators. In the example below, it's assumed that the `sum` and `avg` methods of the `Accumulators` class have been statically
133133
imported.
134134

docs/reference/content/builders/filters.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ title = "Filters"
99

1010
## Filters
1111

12-
The [`Filters`]({{< apiref "org.mongodb.scala.model.Filters$" >}}) class provides static factory methods for all the MongoDB query
12+
The [`Filters`]({{< apiref "org/mongodb/scala/model/Filters$" >}}) class provides static factory methods for all the MongoDB query
1313
operators. Each method returns an instance of the [`Bson`]({{< relref "bson/documents.md#bson" >}}) type, which can in turn be passed to
1414
any method that expects a query filter.
1515

@@ -204,13 +204,13 @@ indexes support $nearSphere.
204204

205205
To make it easier to construct GeoJSON-based filters, the driver also include a full GeoJSON class hierarchy:
206206

207-
- [`Point`]({{< apiref "org.mongodb.scala..model.geojson.package$$Point$" >}}): A representation of a GeoJSON Point.
208-
- [`MultiPoint`]({{< apiref "org.mongodb.scala..model.geojson.package$$MultiPoint$" >}}): A representation of a GeoJSON MultiPoint.
209-
- [`LineString`]({{< apiref "org.mongodb.scala..model.geojson.package$$LineString$" >}}): A representation of a GeoJSON LineString.
210-
- [`MultiLineString`]({{< apiref "org.mongodb.scala..model.geojson.package$$MultiLineString$" >}}): A representation of a GeoJSON MultiLineString.
211-
- [`Polygon`]({{< apiref "org.mongodb.scala..model.geojson.package$$Polygon$" >}}): A representation of a GeoJSON Polygon.
212-
- [`MultiPolygon`]({{< apiref "org.mongodb.scala..model.geojson.package$$MultiPolygon$" >}}): A representation of a GeoJSON MultiPolygon.
213-
- [`GeometryCollection`]({{< apiref "org.mongodb.scala..model.geojson.package$$GeometryCollection$" >}}): A representation of a GeoJSON
207+
- [`Point`]({{< apiref "org/mongodb/scala/model/geojson/package$$Point$" >}}): A representation of a GeoJSON Point.
208+
- [`MultiPoint`]({{< apiref "org/mongodb/scala/model/geojson/package$$MultiPoint$" >}}): A representation of a GeoJSON MultiPoint.
209+
- [`LineString`]({{< apiref "org/mongodb/scala/model/geojson/package$$LineString$" >}}): A representation of a GeoJSON LineString.
210+
- [`MultiLineString`]({{< apiref "org/mongodb/scala/model/geojson/package$$MultiLineString$" >}}): A representation of a GeoJSON MultiLineString.
211+
- [`Polygon`]({{< apiref "org/mongodb/scala/model/geojson/package$$Polygon$" >}}): A representation of a GeoJSON Polygon.
212+
- [`MultiPolygon`]({{< apiref "org/mongodb/scala/model/geojson/package$$MultiPolygon$" >}}): A representation of a GeoJSON MultiPolygon.
213+
- [`GeometryCollection`]({{< apiref "org/mongodb/scala/model/geojson/package$$GeometryCollection$" >}}): A representation of a GeoJSON
214214
GeometryCollection.
215215

216216

docs/reference/content/builders/indexes.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ title = "Indexes"
99

1010
## Indexes
1111

12-
The [`Indexes`]({{< apiref "org.mongodb.scala.model.Indexes$" >}}) class provides static factory methods for all the MongoDB Index key types.
12+
The [`Indexes`]({{< apiref "org/mongodb/scala/model/Indexes$" >}}) class provides static factory methods for all the MongoDB Index key types.
1313
Each method returns an instance of the [`Bson`]({{< relref "bson/documents.md#bson" >}}) type, which can in turn be used with the `createIndex`
1414
methods.
1515

docs/reference/content/builders/projections.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ title = "Projections"
99

1010
## Projections
1111

12-
The [`Projections`]({{< apiref "org.mongodb.scala.model.Projections$" >}}) class provides static factory methods for all the MongoDB
12+
The [`Projections`]({{< apiref "org/mongodb/scala/model/Projections$" >}}) class provides static factory methods for all the MongoDB
1313
projection opererators. Each method returns an instance of the [`Bson`]({{< relref "bson/documents.md#bson" >}}) type, which can in turn
1414
be passed to any method that expects a projection.
1515

docs/reference/content/builders/sorts.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ title = "Sort Criteria "
99

1010
## Sorts
1111

12-
The [`Sorts`]({{< apiref "org.mongodb.scala.model.Sorts$" >}}) class provides static factory methods for all the MongoDB sort criteria
12+
The [`Sorts`]({{< apiref "org/mongodb/scala/model/Sorts$" >}}) class provides static factory methods for all the MongoDB sort criteria
1313
operators. Each method returns an instance of the [`Bson`]({{< relref "bson/documents.md#bson" >}}) type, which can in turn be passed to
1414
any method that expects sort criteria.
1515

docs/reference/content/builders/updates.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ title = "Updates"
99

1010
## Updates
1111

12-
The [`Updates`]({{< apiref "org.mongodb.scala.model.Updates$" >}}) class provides static factory methods for all the MongoDB update
12+
The [`Updates`]({{< apiref "org/mongodb/scala/model/Updates$" >}}) class provides static factory methods for all the MongoDB update
1313
operators. Each method returns an instance of the [`Bson`]({{< relref "bson/documents.md#bson" >}}) type, which can in turn be passed to
1414
any method that expects an update.
1515

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ mongoClient.getDatabase("databaseToBeDropped").drop().headResult()
6161
## Create A Collection
6262

6363
Collections in MongoDB are created automatically simply by inserted a document into it. Using the
64-
[`createCollection`]({{< apiref "org.mongodb.scala.MongoDatabase@createCollection(collectionName:String):org.mongodb.scala.Observable[org.mongodb.scala.Completed]">}}) method,
64+
[`createCollection`]({{< apiref "org/mongodb/scala/MongoDatabase.html#createCollection(collectionName:String):org.mongodb.scala.Observable[org.mongodb.scala.Completed]">}}) method,
6565
you can also create a collection explicitly in order to customize its configuration. For example, to create a capped collection sized to 1 megabyte:
6666

6767
```scala
@@ -99,7 +99,7 @@ collection.createIndex(ascending("i")).printResults("Created an index named: ")
9999

100100
## Get a List of Indexes on a Collection
101101

102-
Use the [`listIndexes()`]({{< apiref "org.mongodb.scala.MongoCollection@listIndexes[C]()(implicite:org.mongodb.scala.Helpers.DefaultsTo[C,org.mongodb.scala.collection.immutable.Document],implicitct:scala.reflect.ClassTag[C]):org.mongodb.scala.ListIndexesObservable[C]">}}) method to get a list of indexes.
102+
Use the [`listIndexes()`]({{< apiref "org/mongodb/scala/MongoCollection.html#listIndexes[C]()(implicite:org.mongodb.scala.Helpers.DefaultsTo[C,org.mongodb.scala.collection.immutable.Document],implicitct:scala.reflect.ClassTag[C]):org.mongodb.scala.ListIndexesObservable[C]">}}) method to get a list of indexes.
103103

104104
```scala
105105
collection.listIndexes().printResults()
@@ -167,13 +167,13 @@ For more information about text search see the [text index]({{< docsref "/core/i
167167
## Running a command
168168

169169
While not all commands have a specific helper, however you can run any [command]({{< docsref "/reference/command">}})
170-
by using the [`runCommand()`]({{< apiref "org.mongodb.scala.MongoDatabase@runCommand[TResult](command:org.bson.conversions.Bson)(implicite:org.mongodb.scala.Helpers.DefaultsTo[TResult,org.mongodb.scala.collection.immutable.Document],implicitct:scala.reflect.ClassTag[TResult]):org.mongodb.scala.Observable[TResult]">}})
170+
by using the [`runCommand()`]({{< apiref "org/mongodb/scala/MongoDatabase.html#runCommand[TResult](command:org.bson.conversions.Bson)(implicite:org.mongodb.scala.Helpers.DefaultsTo[TResult,org.mongodb.scala.collection.immutable.Document],implicitct:scala.reflect.ClassTag[TResult]):org.mongodb.scala.Observable[TResult]">}})
171171
method. Here we call the [buildInfo]({{ docsref "reference/command/buildInfo" }}) command:
172172

173173
```scala
174174
database.runCommand(Document("buildInfo" -> 1)).printHeadResult()
175175
```
176176
{{% note class="important" %}}
177-
If no [`readPreference`]({{< apiref "org.mongodb.scala.package@ReadPreference=com.mongodb.ReadPreference">}}) is passed
177+
If no [`readPreference`]({{< apiref "org/mongodb/scala/package.html#ReadPreference=com.mongodb.ReadPreference">}}) is passed
178178
to `runCommand` then the command will be run on the primary node.
179179
{{% /note %}}

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ The operation completed successfully
107107

108108
## Querying the collection
109109

110-
Use the [find()]({{< apiref "org.mongodb.scala.MongoCollection@find[C](filter:org.bson.conversions.Bson)(implicite:org.mongodb.scala.Helpers.DefaultsTo[C,org.mongodb.scala.collection.immutable.Document],implicitct:scala.reflect.ClassTag[C]):org.mongodb.scala.FindObservable[C]">}})
110+
Use the [find()]({{< apiref "org/mongodb/scala/MongoCollection.html#find[C](filter:org.bson.conversions.Bson)(implicite:org.mongodb.scala.Helpers.DefaultsTo[C,org.mongodb.scala.collection.immutable.Document],implicitct:scala.reflect.ClassTag[C]):org.mongodb.scala.FindObservable[C]">}})
111111
method to query the collection.
112112

113113
### Find the first person in a collection
@@ -170,7 +170,7 @@ Which will print out the Person instances for Gertrude, George and Grace.
170170
## Updating documents
171171

172172
There are numerous [update operators](http://docs.mongodb.org/manual/reference/operator/update-field/)
173-
supported by MongoDB. Use the [Updates]({{< apiref "org.mongodb.scala.model.Updates$">}}) helpers to help update documents in the database.
173+
supported by MongoDB. Use the [Updates]({{< apiref "org/mongodb/scala/model/Updates$">}}) helpers to help update documents in the database.
174174

175175
The following update corrects the hyphenation for Tim Berners-Lee:
176176

@@ -183,7 +183,7 @@ which provides information about the operation including the number of documents
183183

184184
## Deleting documents
185185

186-
To delete at most a single document (may be 0 if none match the filter) use the [`deleteOne`]({{< apiref "org.mongodb.scala.MongoCollection@deleteOne(filter:org.bson.conversions.Bson):org.mongodb.scala.Observable[org.mongodb.scala.result.DeleteResult]">}})
186+
To delete at most a single document (may be 0 if none match the filter) use the [`deleteOne`]({{< apiref "org/mongodb/scala/MongoCollection.html#deleteOne(filter:org.bson.conversions.Bson):org.mongodb.scala.Observable[org.mongodb.scala.result.DeleteResult]">}})
187187
method:
188188

189189
```scala

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,16 @@ libraries and provides easy interoperability with them. For more information se
5050

5151
The MongoDB Scala Driver is built upon the callback-driven MongoDB async driver. The API mirrors the
5252
async driver API and any methods that cause network IO return an instance of the
53-
[`Observable[T]`]({{< apiref "org.mongodb.scala.Observable">}}) where `T` is the type of response for the operation. The
53+
[`Observable[T]`]({{< apiref "org/mongodb/scala/Observable">}}) where `T` is the type of response for the operation. The
5454
exception to that rule is for methods in the async driver that return a `Void` value in the callback.
5555
As an `Observable[Void]` never calls `onNext` it stops it from being composable with other `Observables`, so in these
56-
circumstances we return a [`Observable[Completed]`]({{< apiref "org/mongodb/scala/Completed.html">}}) for the operation instead.
56+
circumstances we return a [`Observable[Completed]`]({{< apiref "org/mongodb/scala/Completed">}}) for the operation instead.
5757

5858
### Observable
5959

60-
The [`Observable`]({{< apiref "org.mongodb.scala.Observable">}}) is a trait wrapping the Java interface and where appropriate
60+
The [`Observable`]({{< apiref "org/mongodb/scala/Observable">}}) is a trait wrapping the Java interface and where appropriate
6161
implementations of the trait extend it to make a fluent API. One such example is
62-
[`FindObservable`]({{< apiref "org.mongodb.scala.FindObservable">}}), accessible through `collection.find()`.
62+
[`FindObservable`]({{< apiref "org/mongodb/scala/FindObservable">}}), accessible through `collection.find()`.
6363

6464
{{% note %}}
6565
All `Observables` returned from the API are cold, meaning that no I/O happens until they are subscribed to. As such an observer is

0 commit comments

Comments
 (0)