8e035fded4
missed the Put side
This commit is contained in:
parent
532e758fe4
commit
8df947c704
1 changed files with 5 additions and 4 deletions
|
@ -294,9 +294,10 @@ putVal (BsonDoc o) = putObj o
|
||||||
putVal (BsonArray es) = putOutterObj bs
|
putVal (BsonArray es) = putOutterObj bs
|
||||||
where bs = runPut $ forM_ (List.zip [(0::Int) .. ] es) $ \(i, e) ->
|
where bs = runPut $ forM_ (List.zip [(0::Int) .. ] es) $ \(i, e) ->
|
||||||
putType e >> putS (L8.fromString $ show i) >> putVal e
|
putType e >> putS (L8.fromString $ show i) >> putVal e
|
||||||
putVal (BsonBinary t bs)= do putI32 $ fromIntegral $ 4 + L.length bs
|
putVal (BsonBinary t bs) = do
|
||||||
|
putI32 $ fromIntegral $ (if t == BSTByteArray then 4 else 0) + L.length bs
|
||||||
putI8 $ fromBinarySubType t
|
putI8 $ fromBinarySubType t
|
||||||
putI32 $ fromIntegral $ L.length bs
|
when (t == BSTByteArray) $ putI32 $ fromIntegral $ L.length bs
|
||||||
putLazyByteString bs
|
putLazyByteString bs
|
||||||
putVal BsonUndefined = putNothing
|
putVal BsonUndefined = putNothing
|
||||||
putVal (BsonObjectId o) = putWord64be (fromIntegral $ o `shiftR` 32) >>
|
putVal (BsonObjectId o) = putWord64be (fromIntegral $ o `shiftR` 32) >>
|
||||||
|
|
Loading…
Reference in a new issue