[SERVER-62961] Fix ABT->SBE lowering of EvalFilter paths to correctly handle comparisons with arrays Created: 25/Jan/22  Updated: 29/Oct/23  Resolved: 31/May/22

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

Type: Bug Priority: Major - P3
Reporter: Hana Pearlman Assignee: Svilen Mihaylov (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

When lowering PathTraverse within EvalFilter, it is sometimes necessary to execute the LambdaAbstraction against each element of the array and the whole array itself, rather than just the elements of the array.

This approach is preferred to SERVER-62376 because we'd rather keep the ABT simple and allow the lowering code to inject the logic needed to handle these particular cases. See Fix ‘find({a: [1]})’ for ABT discussion for details.

Here are some examples where ABT->SBE lowering currently does not produce correct results:

  • ‘find({a: [1]})’ should match both ‘{a: [1]}’ and ‘{a: [[1]]}’
  • ‘find({a: {$in: [[1],[2]]}})’ should match both ‘{a: [1]}’ and ‘{a: [[1]]}’
  • ‘find({a: {$type: “array”}})’ should match ‘{a: [1]}’ and ‘{a: [[1]]}’

This issue could potentially affect the $exists operator as well.

The goal of this task is to update ABT->SBE lowering so that it generates whatever is necessary to produce correct results for the cases listed above.



 Comments   
Comment by Githook User [ 27/May/22 ]

Author:

{'name': 'Svilen Mihaylov', 'email': 'svilen.mihaylov@mongodb.com', 'username': 'smihaylov-mongodb'}

Message: SERVER-62961 Fix ABT->SBE lowering of EvalFilter paths to correctly handle comparisons with arrays
Branch: master
https://github.com/mongodb/mongo/commit/c812983558ae5a4543db6b16f26ce1190edfdef7

Generated at Thu Feb 08 05:56:32 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.