Skip to content

Commit b11a0cd

Browse files
author
Chris Cho
authored
Merge pull request #220 from ccho-mongodb/DOCSP-32387-fix-csharp-update
DOCSP-32387: fix csharp update a document code
2 parents aa24a1d + d70aa13 commit b11a0cd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

source/includes/code/dotnet/CrudUpdateFinalQuery.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using MongoDB.Bson;
22
using MongoDB.Driver;
3+
using MongoDB.Bson.Serialization.Conventions;
34

45
// Replace the uri string with your MongoDB deployment's connection string.
56
var uri = "mongodb+srv://<user>:<password>@<cluster-url>?retryWrites=true&writeConcern=majority";
@@ -12,7 +13,7 @@
1213

1314
// database and collection code goes here
1415
var db = client.GetDatabase("sample_guides");
15-
var coll = db.GetCollection<BsonDocument>("comets");
16+
var coll = db.GetCollection<Comet>("comets");
1617

1718
// update code goes here
1819
var filter = Builders<Comet>.Filter.Empty;

0 commit comments

Comments
 (0)