Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

bsonUtils in README

  • Loading branch information...
commit 34558bf2387942fe15ff75f82290929b9cb2db1c 1 parent 5d5a197
@stijnsanders authored
Showing with 15 additions and 0 deletions.
  1. +15 −0 README
View
15 README
@@ -26,3 +26,18 @@ mongoWire.pas
http://yoy.be/TMongoWire
https://github.com/stijnsanders/TMongoWire
+
+
+Additional tools
+----------------
+
+bsonUtils.pas
+ 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)
Please sign in to comment.
Something went wrong with that request. Please try again.