0
我们如何将字节数组转换为字符串?为什么MongoDB.Bson.BsonExtensionMethods.ToBson返回字节数组而不是字符串?
我所做的:
Dim queryPlaces = Query.WithinRectangle("LongitudeLatitude", (Longitude - eachStepLongitude), (Latitude - minimumBlock), (Longitude + eachStepLongitude), (Latitude + minimumBlock))
LogEvents(queryPlaces.ToBson.ToString)
这是为vb.net语言mongdob驱动程序。
我很惊讶地发现queryPlaces.ToBson返回字节而不是字符串。此外ToBson.ToString简单地返回这个没用的字符串:
System.Byte[]
如果你想要一个可读的字符串,为什么不使用'ToJSON'来代替? BSON中的“B”代表“二元”,因此你看到... – McGarnagle
啊。请把它变成答案。 –