Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-1512

Legacy $regex extended JSON not parsed

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 1.3.0
    • Component/s: JSON & ExtJSON
    • Labels:
      None

      The driver fails to parse the legacy regular expression type of this document:

      {"":{"$regex":"","$options":""}}
      

      Output (hex form):

      280000000300210000000224726567657800010000000002246f7074696f6e730001000000000000
      

      Other examples:

      {"":{"$regex":"abc","$options":"i"}}
      2c0000000300250000000224726567657800040000006162630002246f7074696f6e73000200000069000000
      {"":{"$options":"i","$regex":"abc"}}
      2c00000003002500000002246f7074696f6e7300020000006900022472656765780004000000616263000000
      
      // These should error due to the extra key
      {"":{"$regex":"abc","$options":"i","0":""}}
      3400000003002d0000000224726567657800040000006162630002246f7074696f6e730002000000690002300001000000000000
      {"":{"$options":"i","$regex":"abc","0":""}}
      3400000003002d00000002246f7074696f6e73000200000069000224726567657800040000006162630002300001000000000000
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            david.golden@mongodb.com David Golden
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: