Browse files

bsonUtils in README

  • Loading branch information...
1 parent 5d5a197 commit 34558bf2387942fe15ff75f82290929b9cb2db1c @stijnsanders committed Jun 23, 2012
Showing with 15 additions and 0 deletions.
  1. +15 −0 README
@@ -26,3 +26,18 @@ mongoWire.pas
+Additional tools
+ function BsonToJson(Doc:IBSONDocument):WideString;
+ Converts a BSON document into a JSON string.
+ function JsonToBson(jsonData:WideString):IBSONDocument;
+ Converts a JSON string into a BSON document.
+ procedure JsonIntoBson(jsonData:WideString;doc:IBSONDocument); overload;
+ Parses a JSON string and adds any keys to an existing BSON document, overwriting the value if a key already exists.
+ procedure JsonIntoBson(jsonData:WideString;doc:IBSONDocument;var EndIndex:integer); overload;
+ Parses only the first JSON object from a string into an existing BSON document, and returns the index into the string where the JSON object ends.
+ Use this method to iterate over a list of JSON strings. (See also IBSONDocument.Clear)

0 comments on commit 34558bf

Please sign in to comment.