Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-2291

How to add new field to bsoncxx::document::value?

      Hello, I have a JSON string and I need to add a field to it. Here was my first approach:

      auto doc = from_json(jsonStr);
      document builder{ doc.release() };
      builder.append(kvp("$currentDate", make_document(kvp("lastModified", true))));
      

      But I realize that a builder cannot be initialized from a document::value in any way. So my question is how can I:

      • Parse a JSON string
      • Append a new field
      • Get the resulting document::value

            Assignee:
            Unassigned Unassigned
            Reporter:
            puya@motionmetrics.com Puya Daravi
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: