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

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

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Critical - P2 Critical - P2
    • 3.4.2, 3.5.2
    • Affects Version/s: 3.4.1
    • Component/s: 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

      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}.

        1. backtrace.txt
          18 kB
          Claudio Petrini

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

              Created:
              Updated:
              Resolved: