I found a workaround. You can create a BsonDocument, like this:
public BsonDocument Equals(string field, string value, double? boost = null)
{
var equalsDef = new BsonDocument
{
{
"equals",
new BsonDocument { { "path", field }, { "value", value } }
}
};
if (boost.HasValue)
{
equalsDef["equals"]["score"] = new BsonDocument
{
{
"boost",
new BsonDocument { { "value", boost } }
}
};
}
return equalsDef;
}