Uploaded image for project: 'MongoDB Shell'
  1. MongoDB Shell
  2. MONGOSH-1452

Inconsistent use of single and double quotes for strings

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Trivial - P5 Trivial - P5
    • 2.1.0
    • Affects Version/s: 1.8.0
    • Component/s: Bson
    • None
    • Environment:
      OS:
      node.js / npm versions:
      Additional info:
    • 2
    • Iteration Minmi, Iteration Nodosaurus
    • Not Needed

      Problem Statement/Rationale

      I noticed that strings are inconsistently quoted in shell output. Double quotes are used for arguments to BSON classes (e.g. ObjectId, ISODate), while single quotes are used elsewhere.

      For example:

      test> db.foo.find()
      [
        {
          _id: '6462e1acce3d12b9e229d5fd',
          title: 'Agent Zero',
          releaseDate: ISODate("1995-11-16T00:00:00.000Z"),
          tags: [ 'action', 'thriller' ]
        },
        {
          _id: ObjectId("6462e1acce3d12b9e229d5fd"),
          title: 'Agent Zero',
          year: 1995
        }
      ]
      

      I noticed the above in mongosh-1.8.0, but it probably exists in earlier versions. This may also be a relic of the original mongo shell.

            Assignee:
            anna.henningsen@mongodb.com Anna Henningsen
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: