Uploaded image for project: 'CloverDX'
  1. CloverDX
  2. CLO-18637

Add parseBson(byte, string) function

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Security Level: Users (General product issues)
    • Labels:
      None

      Description

      • function variant parseBson(byte bson, string key) - deserializes all elements with passed-in key from the BSON/bytes representation into list of variant objects or null if no such key exists in BSON representation.
        variant myvariant;
        myvariant=parseBson(hex2byte(“35000000026369747900080000006368696361676f00026e616d6500080000006a6f6e5f646f650002616765000300000032320000”),”name”);
        printErr(myvariant);
        

        Produces following output:

        [jon_doe]
        

        Note: The result is an CTL list containing 1 element - a string

        variant obj=json2obj('\{"city":"chicago","name":"jon_doe", "other":{"name":"junior"},"age":"22"}');
        byte byteval=obj2bson(obj);
        printErr(parseBson(byteval,"name"));
        

        Produces following output:

        [jon_doe, junior]
        

        Note: The result is an CTL list containing 2 element - strings, found in the whole hierarchy of BSON data

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              slamam Martin Slama
              Reporter:
              krivanekm Milan Krivanek
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: