Skip to content

Commit 42cc570

Browse files
committed
Add C# examples to SELECT documentation
1 parent ffba577 commit 42cc570

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

docs/40-CRUD/2-SELECT.mdx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Here:
8888

8989
await cursor.forEach((b) => {
9090
console.log(b);
91-
});
91+
});
9292
```
9393
</div>
9494

@@ -100,6 +100,14 @@ Here:
100100
```
101101
</div>
102102
</TabItem>
103+
<TabItem value="csharp" label="C#">
104+
<div>
105+
```csharp
106+
var projection = Builders<Book>.Projection.Include(b => b.Title).Exclude(b => b.Id);
107+
booksCollection.Find(b => true).Project<Book>(projection);
108+
```
109+
</div>
110+
</TabItem>
103111
</Tabs>
104112
</details>
105113

@@ -126,5 +134,13 @@ Here:
126134
```
127135
</div>
128136
</TabItem>
137+
<TabItem value="csharp" label="C#">
138+
<div>
139+
```csharp
140+
var projection = Builders<Book>.Projection.Exclude(b => b.Authors).Exclude(b => b.Id);
141+
booksCollection.Find(b => true).Project<Book>(projection);
142+
```
143+
</div>
144+
</TabItem>
129145
</Tabs>
130146
</details>

0 commit comments

Comments
 (0)