Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-12601

Shell REPL doesn't properly print literal objects containing an _id field

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • 2.5.5
    • Shell
    • ALL

    Description

      The following examples illustrate strange behavior with the shell REPL's handling of objects with an _id field. Note that all of these should be valid, and should print the object itself:

      > {_id:1}
      1
      > {'_id':1}
      2014-02-04T11:51:48.382-0500 SyntaxError: Unexpected token :
      > {"_id":1}
      2014-02-04T11:51:54.014-0500 SyntaxError: Unexpected token :
      > var a = {"_id":1}
      > a
      { "_id" : 1 }
      > var a = {_id:1}
      > a
      { "_id" : 1 }

      Attachments

        Activity

          People

            Unassigned Unassigned
            benjamin.becker Ben Becker
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: