[SERVER-77034] Mongodb 4.4 doesn't support $search field names Created: 11/May/23  Updated: 02/Jan/24  Resolved: 02/Jan/24

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Alex Franzen Assignee: Backlog - Query Integration
Resolution: Gone away Votes: 0
Labels: qi-search
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Assigned Teams:
Query Integration
Operating System: ALL
Steps To Reproduce:

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

Participants:

 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



 Comments   
Comment by Xiaochen Wu [ 11/May/23 ]

We can backlog this for now. colby.ing@mongodb.com will follow up with elle.shwer@mongodb.com on the future discussion if we even need to fix this for 4.4 later. 

Comment by Nicholas Zolnierz [ 11/May/23 ]

ted.tuckman@mongodb.com james.wahlin@mongodb.com do you think this falls in the QI realm for search or a more generic bug around referencing $-prefixed field names in a profile filter?

Generated at Thu Feb 08 06:34:20 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.