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

Unexpected characters are reported as invalid numbers

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: JSON & ExtJSON
    • None

      Problem Description

      When I use mongodump with -q argument and I specify a timestamp and I add a closing parenthesis after the i value, I get an error message reading "invalid JSON number" when the number I provided is, as far as I can tell, perfectly valid and the problem is there are additional unexpected characters in input.

      Steps to Reproduce

      serene% ~me/debs/mongo/tools/mongodump  --port 14700   -q '{"ts":{"$timestamp":{"t":1578475955, "i":1)}}}' -c test -d ruby-driver        
      2021-03-21T08:43:11.316-0400	Failed: error parsing query as Extended JSON: error decoding key ts: invalid JSON number. Position: 41
      

      Expected Results

      I expected the error message to reflect the actual error (unexpected ), unbalanced ), invalid syntax for a hash, etc.)

      Actual Results

      The error message complains about the integer being invalid.

      Additional Notes

            Assignee:
            Unassigned Unassigned
            Reporter:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: