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

create an $eq operator for queries that works similar to $gte and $lte

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.5.0
    • Component/s: Querying
    • Labels:
      None

      Description

      We are writing a simple ORM for python called maroon. (http://github.com/nod/maroon) Our library builds mongo queries dynamically from python code that looks like this:
      results = Things.find((j==3)&(k>10))

      Right now we have to treat equality as a special case when we do ands and ors:
      db.things.find({j: 3, k: {$gt: 10} });

      It it would make our code simpler and more consistent if $eq was an operator. For example:
      db.things.find({j: {$eq: 3}, k: {$gt: 10} });

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              eliot Eliot Horowitz (Inactive)
              Reporter:
              jeffamcgee Jeff McGee
              Participants:
              Votes:
              9 Vote for this issue
              Watchers:
              10 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: