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

Object properties with $ doesn't work without quotes in find()

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Trivial - P5
    • Resolution: Won't Fix
    • None
    • None
    • None
    • None

    Description

      In the mongo console using $ in property names work, eg:

      > var a = {}
      > a
      {}
      > a.$ref = "test"
      test
      > a.$ref
      test

      However, in MongoDB when using this in the find method I need to quote the property name for things to work.

      db.foo.find(

      {"a.$ref":"test"}

      )

      Attachments

        Activity

          People

            eliot Eliot Horowitz (Inactive)
            sandstrom sandstrom
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: