Vb.net 为什么MongoDB.Bson.BsonExtensionMethods.ToBson返回字节数组而不是字符串?
我们如何将字节数组转换成字符串 我做到了:Vb.net 为什么MongoDB.Bson.BsonExtensionMethods.ToBson返回字节数组而不是字符串?,vb.net,mongodb,Vb.net,Mongodb,我们如何将字节数组转换成字符串 我做到了: Dim queryPlaces = Query.WithinRectangle("LongitudeLatitude", (Longitude - eachStepLongitude), (Latitude - minimumBlock), (Longitude + eachStepLongitude), (Latitude + minimumBlock)) LogEvents(queryPlaces.ToBs
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
ToBSON
返回。如果您想要一个可读的字符串,为什么不使用ToJSON
?BSON中的“B”代表“二进制”,因此您会看到……啊。请把它变成一个答案。