Mongodb 4.4 doesn't support $search field names

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Gone away
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Integration
    • ALL
    • Hide

      1. Mongodb 4.4
      2.

      db.setProfilingLevel(0, { filter: { $or: [ { millis: { $gte: 1 } }, { $and: [ { $sampleRate: 1 }, { "command.pipeline.0.$search.tracking.searchTerms": { $exists: true } }] }] } });
      

      Note:

       db.setProfilingLevel(0, { filter: { $or: [ { millis: { $gte: 1 } }, { $and: [ { $sampleRate: 1 }, { "command.pipeline.0.tracking.searchTerms": { $exists: true } }] }] } });
      

      without the $search term works fine

      Show
      1. Mongodb 4.4 2. db.setProfilingLevel(0, { filter: { $or: [ { millis: { $gte: 1 } }, { $and: [ { $sampleRate: 1 }, { "command.pipeline.0.$search.tracking.searchTerms" : { $exists: true } }] }] } }); Note: db.setProfilingLevel(0, { filter: { $or: [ { millis: { $gte: 1 } }, { $and: [ { $sampleRate: 1 }, { "command.pipeline.0.tracking.searchTerms" : { $exists: true } }] }] } }); without the $search term works fine
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      I’m on the intel team and we ran into an issue where mongodb 4.4 doesn’t support FieldPath field names that start with ‘$’.

      This is an issue because the filter expression we use to power our Search Query telemetry project uses the $search stage to emit search queries
      (we’re using this filter expression command:

      db.setProfilingLevel(0, { filter: { $or: [ { millis: { $gte: 1 } }, { $and: [ { $sampleRate: 1 }, { "command.pipeline.0.$search.tracking.searchTerms": { $exists: true } }] }] } });
      

      )

      This $ field name support isn’t an issue with 5.0+ mongodb versions, and we can run the above command without issue

      Initial investigations point me to believe it may just be a MatchExpression parsing issue

            Assignee:
            [DO NOT USE] Backlog - Query Integration
            Reporter:
            Alex Franzen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: