/// <summary>
 /// Json serialize a BsonValue into a TextWriter
 /// </summary>
 public static void Serialize(BsonValue value, TextWriter writer, bool pretty = false, bool writeBinary = true)
 {
     var w = new JsonWriter(writer);
     w.Pretty = pretty;
     w.WriteBinary = writeBinary;
     w.Serialize(value ?? BsonValue.Null);
 }