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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor - P4
    • Resolution: Works as Designed
    • 3.0.4
    • None
    • Querying
    • None
    • 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

            wan.bachtiar@mongodb.com Wan Bachtiar
            rwander Roman
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: