आप उपरोक्त दस्तावेज़ को निम्नलिखित कथन के साथ C# में बना सकते हैं:
var document = new BsonDocument {
{ "author", "joe" },
{ "title", "yet another blog post" },
{ "text", "here is the text..." },
{ "tags", new BsonArray { "example", "joe" } },
{ "comments", new BsonArray {
new BsonDocument { { "author", "jim" }, { "comment", "I disagree" } },
new BsonDocument { { "author", "nancy" }, { "comment", "Good post" } }
}}
};
आप जांच कर सकते हैं कि क्या आपने सही परिणाम दिया है:
var json = document.ToJson();