Skip to content

Commit 1b5894c

Browse files
CSHARP-2976: Document How to do collations with LINQ.
1 parent 0f8ce41 commit 1b5894c

File tree

1 file changed

+9
-0
lines changed
  • Docs/reference/content/reference/driver/crud

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,15 @@ var query = collection.AsQueryable()
6969
]
7070
```
7171

72+
Also, there is a list of aggregate options that can be applied for the whole pipeline via [`AggregationOptions`]({{< apiref "T_MongoDB_Driver_AggregateOptions" >}}). Below is an example of configuring a [`Collation`]({{< docsref "reference/collation/" >}}):
73+
74+
```csharp
75+
var collation = new Collation("en_US", strength: CollationStrength.Secondary);
76+
var aggregateOptions = new AggregateOptions { Collation = collation };
77+
var query = collection
78+
.AsQueryable(aggregateOptions)
79+
.Where(p => p.Name == "tom");
80+
```
7281

7382
### Stages
7483

0 commit comments

Comments
 (0)