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

Operator $or(query) and operator $(projection) don't work together.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Works as Designed
    • Affects Version/s: 3.0.4
    • Fix Version/s: None
    • Component/s: Querying
    • Labels:
      None
    • Operating System:
      ALL

      Description

      QUERY:

      db.users.find({
                                  $or: [
                                      {
                                              _id: senderId,
                                              "_contacts._profile_id": recipientId
                                      },
                                      {
                                          _id: recipientId,
                                          "_contacts._profile_id": senderId
                                      }
                                  ]
      },
      {
      "_contacts.$": 1
      })
      

      ERROR:
      BadValue positional operator (_contacts.$) requires corresponding field in query specifier","code":17144} must be equivalent to undefined

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: