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

Don't error on serialization of $elemMatch with $regex

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical - P2
    • Resolution: Fixed
    • Affects Version/s: 3.4.1
    • Fix Version/s: 3.4.2, 3.5.2
    • Component/s: Querying
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v3.4
    • Steps To Reproduce:
      Hide

      On Mongo v3.4.1 execute the following query:

      {
          fieldA: 'valueA',
          fieldB: 'valueB',
          sub_categories: {
              '$elemMatch': {
                  '$regex': '^abc$' 
              }
          }
      }
      

      The collection queried has indexes as described in the description, the error happens only when sorting with this value {_id : 1}

      Show
      On Mongo v3.4.1 execute the following query: { fieldA: 'valueA', fieldB: 'valueB', sub_categories: { '$elemMatch': { '$regex': '^abc$' } } } The collection queried has indexes as described in the description, the error happens only when sorting with this value {_id : 1}
    • Sprint:
      Query 2017-01-23
    • Case:

      Description

      Hi,
      after the upgrade to Mongo 3.4.1 we're having this error "Error: assertion src/mongo/bson/bsonelement.cpp:449" caused from the query described in the Steps to Reproduce the error.

      The collection on which the query is executed has the following indexes :

      1. _id: the default index
      2. (fieldA, fieldB) : a compound index

      This error happens only when the sort query parameter is configured to {_id : 1}.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: