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

Mongodb 4.4 doesn't support $search field names

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Major - P3 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

      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:
            backlog-query-integration [DO NOT USE] Backlog - Query Integration
            Reporter:
            alex.franzen@mongodb.com Alex Franzen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: