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

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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Critical - P2
    • Resolution: Fixed
    • 3.4.1
    • 3.4.2, 3.5.2
    • Querying
    • None
    • Fully Compatible
    • ALL
    • v3.4
    • 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}
    • Query 2017-01-23

    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

              james.wahlin@mongodb.com James Wahlin
              claudio.petrini@stamplay.com Claudio Petrini
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: