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

Mongodb 4.4 doesn't support $search field names

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • 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

    Description

      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

      Attachments

        Activity

          People

            backlog-query-integration Backlog - Query Integration
            alex.franzen@mongodb.com Alex Franzen
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

              Created:
              Updated: