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

Timeseries query with nested $elemMatch incorrectly uasserts

    • Query Integration
    • ALL
    • Hide
      const q = [
          {
              "$match": {
                  "a": {
                      "$elemMatch": {
                          "$elemMatch": {"$eq": 0},
                          "$eq": 0
                      }
                  }
              }
          },
          {"$project": {"b": "$a"}}
      ]
      const coll = db.c;
      assert(coll.drop())
      assert.commandWorked(db.createCollection(coll.getName(), {timeseries: {timeField: 't', metaField: 'm'}}));
      assert.commandWorked(coll.insert([
        {
          "_id" : 0,
          "t" : ISODate("1970-01-01T00:00:00Z"),
          "a" : 0,
        }
      ]))
      coll.aggregate(q).toArray()
      // Code 40352, "FieldPath cannot be constructed with empty string"
      
      Show
      const q = [ { "$match" : { "a" : { "$elemMatch" : { "$elemMatch" : { "$eq" : 0}, "$eq" : 0 } } } }, { "$project" : { "b" : "$a" }} ] const coll = db.c; assert (coll.drop()) assert .commandWorked(db.createCollection(coll.getName(), {timeseries: {timeField: 't' , metaField: 'm' }})); assert .commandWorked(coll.insert([ { "_id" : 0, "t" : ISODate( "1970-01-01T00:00:00Z" ), "a" : 0, } ])) coll.aggregate(q).toArray() // Code 40352, "FieldPath cannot be constructed with empty string"
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The following query succeeds on a regular collection, but uasserts on a time-series collection.
      This query doesn't make much sense since it cannot match any documents. However for computer generated queries it's possible a user can create this

      Looks different from SERVER-99768, since that involves the bounded sorter and wildcard indexes. Though they both involve errors from FieldPath

            Assignee:
            Unassigned Unassigned
            Reporter:
            matt.boros@mongodb.com Matt Boros
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              None
              None
              None
              None