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

"Query" as a property name is allowed, however querying on it is not possible

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Operating System:
      ALL

      Description

      If you have a document with the property name "query" in it, queries with $ne will not work.
      Example:

      db.coll.insert({ query: 'foo' })'
      db.coll.findOne({ query: { $ne: 'bar' } });
      

      Exact equality searches work:

      db.coll.findOne({ query: 'foo' });
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: