If you want to limit the results to specific fields you need to use SetFields
on the MongoCursor
like so:
MongoCursor<BsonDocument> cursor = _db.GetCollection<BsonDocument>.FindAll(); // or any other query
cursor.SetFields("username");
MongoD
uses BSON
which means Binary JSON
. If you want to use it as a JSON
use the extension method:
BsonDocument document;
document.ToJson();