Skip to content

Commit aec9386

Browse files
committed
CSHARP-1872: Fix documentation links to sample code in tests.
1 parent a4bb0e2 commit aec9386

File tree

5 files changed

+15
-14
lines changed

5 files changed

+15
-14
lines changed

Docs/reference/content/reference/driver/crud/linq.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ title = "LINQ"
1111

1212
## LINQ
1313

14-
The driver contains an implementation of [LINQ]({{< msdnref "bb397926" >}}) that targets the [aggregation framework]({{< docsref "aggregation" >}}). The aggregation framework holds a rich query language that maps very easily from a LINQ expression tree making it straightforward to understand the translation from a LINQ statement into an aggregation framework pipeline. To see a more complicated uses of LINQ from the driver, see the [AggregationSample]({{< srcref "MongoDB.Driver.Tests/Samples/AggregationSample.cs" >}}) source code.
14+
The driver contains an implementation of [LINQ]({{< msdnref "bb397926" >}}) that targets the [aggregation framework]({{< docsref "aggregation" >}}). The aggregation framework holds a rich query language that maps very easily from a LINQ expression tree making it straightforward to understand the translation from a LINQ statement into an aggregation framework pipeline. To see a more complicated uses of LINQ from the driver, see the [AggregationSample]({{< testref "MongoDB.Driver.Tests/Samples/AggregationSample.cs" >}}) source code.
1515

1616
For the rest of this page, we'll use the following class:
1717

@@ -320,7 +320,7 @@ var query = from p in collection.AsQueryable()
320320

321321
### Supported Methods
322322

323-
The method examples are shown in isolation, but they can be used and combined with all the other methods as well. You can view the tests for each of these methods in the [MongoQueryableTests]({{< srcref "MongoDB.Driver.Tests/Linq/MongoQueryableTests.cs" >}}).
323+
The method examples are shown in isolation, but they can be used and combined with all the other methods as well. You can view the tests for each of these methods in the [MongoQueryableTests]({{< testref "MongoDB.Driver.Tests/Linq/MongoQueryableTests.cs" >}}).
324324

325325

326326
#### Any

Docs/reference/content/reference/driver/crud/reading.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ This will result in the following aggregation pipeline getting sent to the serve
203203

204204
{{% note %}}You can call `ToString` on the pipeline to see what would be sent to the server.{{% /note %}}
205205

206-
More samples are located in the [source]({{< srcref "MongoDB.Driver.Tests/Samples/AggregationSample.cs" >}}).
206+
More samples are located in the [source]({{< testref "MongoDB.Driver.Tests/Samples/AggregationSample.cs" >}}).
207207

208208
### Stage Operators
209209

Docs/reference/content/reference/driver/definitions.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Both of these will render the filter `{ x: 1 }`.
6767

6868
### Filter Definition Builder
6969

70-
_See the [tests]({{< srcref "MongoDB.Driver.Tests/FilterDefinitionBuilderTests.cs" >}}) for examples._
70+
_See the [tests]({{< testref "MongoDB.Driver.Tests/FilterDefinitionBuilderTests.cs" >}}) for examples._
7171

7272
The [`FilterDefinitionBuilder<TDocument>`]({{< apiref "T_MongoDB_Driver_FilterDefinitionBuilder_1" >}}) provides a type-safe API for building up both simple and complex [MongoDB queries]({{< docsref "reference/operator/query/" >}}).
7373

@@ -172,7 +172,7 @@ Both of these will render the projection `{ x: 1 }`.
172172

173173
### Projection Definition Builder
174174

175-
_See the [tests]({{< srcref "MongoDB.Driver.Tests/ProjectionDefinitionBuilderTests.cs" >}}) for examples._
175+
_See the [tests]({{< testref "MongoDB.Driver.Tests/ProjectionDefinitionBuilderTests.cs" >}}) for examples._
176176

177177
The [`ProjectionDefinitionBuilder<TDocument>`]({{< apiref "T_MongoDB_Driver_ProjectionDefinitionBuilder_1" >}}) exists to make it easier to build up projections in MongoDB's syntax. For the projection `{ x: 1, y: 1, _id: 0 }`:
178178

@@ -223,7 +223,7 @@ The driver supports using expression trees to render projections. The same expre
223223

224224
##### Find
225225

226-
_See the [tests]({{< srcref "MongoDB.Driver.Tests/Linq/Translators/FindProjectionTranslatorTests.cs" >}}) for examples._
226+
_See the [tests]({{< testref "MongoDB.Driver.Tests/Linq/Translators/FindProjectionTranslatorTests.cs" >}}) for examples._
227227

228228
When a Find projection is defined using a lambda expression, it is run client-side. The driver inspects the lambda expression to determine which fields are referenced and automatically constructs a server-side projection to return only those fields.
229229

@@ -259,14 +259,14 @@ The `_id` field is excluded automatically when we know for certain that it isn't
259259

260260
##### Aggregate
261261

262-
_See the [tests]({{< srcref "MongoDB.Driver.Tests/Linq/Translators/AggregateProjectionTranslatorTests_Project.cs" >}}) for examples._
262+
_See the [tests]({{< testref "MongoDB.Driver.Tests/Linq/Translators/AggregateProjectionTranslatorTests_Project.cs" >}}) for examples._
263263

264264
When an aggregate projection is defined using a lambda expression, a majority of the [aggregation expression operators]({{< docsref "reference/operator/aggregation/#expression-operators" >}}) are supported and translated. Unlike a project for Find, no part of the lambda expression is run client-side. This means that all expressions in a projection for the [Aggregation Framework]({{< docsref "core/aggregation-pipeline/" >}}) must be expressible on the server.
265265

266266

267267
##### Grouping
268268

269-
_See the [tests]({{< srcref "MongoDB.Driver.Tests/Linq/Translators/AggregateProjectionTranslatorTests_Group.cs" >}}) for examples._
269+
_See the [tests]({{< testref "MongoDB.Driver.Tests/Linq/Translators/AggregateProjectionTranslatorTests_Group.cs" >}}) for examples._
270270

271271
A projection is also used when performing grouping in the [Aggregation Framework]({{< docsref "core/aggregation-pipeline/" >}}). In addition to the expression operators used in an aggregate projection, the [aggregation accumulator operators]({{< docsref "reference/operator/aggregation/group/#accumulator-operator" >}}) are also supported.
272272

@@ -287,7 +287,7 @@ Both of these will render the sort `{ x: 1 }`.
287287

288288
### Sort Definition Builder
289289

290-
_See the [tests]({{< srcref "MongoDB.Driver.Tests/SortDefinitionBuilderTests.cs" >}}) for examples._
290+
_See the [tests]({{< testref "MongoDB.Driver.Tests/SortDefinitionBuilderTests.cs" >}}) for examples._
291291

292292
The [`SortDefinitionBuilder<TDocument>`]({{< apiref "T_MongoDB_Driver_SortDefinitionBuilder_1" >}}) provides a type-safe API for building up [MongoDB sort syntax]({{< docsref "reference/method/cursor.sort/" >}}).
293293

@@ -345,7 +345,7 @@ Both of these will render the update `{ $set: { x: 1 } }`.
345345

346346
### Update Definition Builder
347347

348-
_See the [tests]({{< srcref "MongoDB.Driver.Tests/UpdateDefinitionBuilderTests.cs" >}}) for examples._
348+
_See the [tests]({{< testref "MongoDB.Driver.Tests/UpdateDefinitionBuilderTests.cs" >}}) for examples._
349349

350350
The [`UpdateDefinitionBuilder<TDocument>`]({{< apiref "T_MongoDB_Driver_UpdateDefinitionBuilder_1" >}}) provides a type-safe API for building the [MongoDB update specification]({{< docsref "reference/operator/update/" >}}).
351351

@@ -405,7 +405,7 @@ Both of these will render the keys `{ x: 1 }`.
405405

406406
### Index Keys Definition Builder
407407

408-
_See the [tests]({{< srcref "MongoDB.Driver.Tests/IndexKeysDefinitionBuilderTests.cs" >}}) for examples._
408+
_See the [tests]({{< testref "MongoDB.Driver.Tests/IndexKeysDefinitionBuilderTests.cs" >}}) for examples._
409409

410410
The [`IndexKeysDefinitionBuilder<TDocument>`]({{< apiref "T_MongoDB_Driver_IndexKeysDefinitionBuilder_1" >}}) provides a type-safe API to build an index keys definition.
411411

Docs/reference/content/reference/driver/expressions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class Pet
4141

4242
## Filters
4343

44-
We'll walk through the supported expressions below. The [tests]({{< srcref "MongoDB.Driver.Tests/Linq/Translators/PredicateTranslatorTests.cs" >}}) are also a good reference.
44+
We'll walk through the supported expressions below. The [tests]({{< testref "MongoDB.Driver.Tests/Linq/Translators/PredicateTranslatorTests.cs" >}}) are also a good reference.
4545

4646
### Comparison
4747

@@ -373,7 +373,7 @@ Find(x => x.FavoriteNumbers.Count() == 3);
373373

374374
## Aggregation Projections
375375

376-
We'll walk through the supported expressions below. The [tests]({{< srcref "MongoDB.Driver.Tests/Linq/Translators/AggregateProjectTranslatorTests.cs" >}}) are also a good reference.
376+
We'll walk through the supported expressions below. The [tests]({{< testref "MongoDB.Driver.Tests/Linq/Translators/AggregateProjectTranslatorTests.cs" >}}) are also a good reference.
377377

378378
### Boolean Expressions
379379

@@ -1070,7 +1070,7 @@ p => p.Name ?? "awesome";
10701070

10711071
See the [MongoDB documentation]({{< docsref "meta/aggregation-quick-reference/#accumulators" >}}) for more information on each operator.
10721072

1073-
Also, the [tests]({{< srcref "MongoDB.Driver.Tests/Linq/Translators/AggregateGroupTranslatorTests.cs" >}}) are a good reference.
1073+
Also, the [tests]({{< testref "MongoDB.Driver.Tests/Linq/Translators/AggregateGroupTranslatorTests.cs" >}}) are a good reference.
10741074

10751075
{{% note %}}These are only supported in a grouping expression.{{% /note %}}
10761076

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
https://github.com/mongodb/{{ .Page.Site.Data.mongodb.githubRepo }}/blob/{{ .Page.Site.Data.mongodb.githubBranch }}/{{ if eq (in (.Get 0) "tests/") false }}tests/{{ end }}{{ .Get 0 }}

0 commit comments

Comments
 (0)