Add support for parsing JSON strings with placeholders

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Won't Do
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Serialization
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      It is often useful to represent a BSON document as a JSON string, if for no other reason than it is usually easier to construct a string value representing a complex document than to directly construct the BsonDocument itself.

      However, if the document is not a constant, then we need some way to inject values into it.

      For example, rather than:

      var name = "John";
      var age = 11;
      var document = Json.Parse(string.Format("{{ name : \"{0}\", age: {1} }}", name, age));
      

      It would be much nicer to write:

      var document = Json.Parse("{ name : #, age : # }", name, age);
      

      Or something similar to that (the exact syntax needs to be determined).

      Not only would this be much friendlier than formatting up strings with values inside it, it would also avoid all sorts of dangers that might crop up if the values inserted into the formatted string aren't properly formatted or escaped.

            Assignee:
            Unassigned
            Reporter:
            Robert Stam (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: