[SERVER-22404] Extend MatchExpression to support matching Documents Created: 01/Feb/16 Updated: 06/Dec/22 Resolved: 08/Mar/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework, Internal Code |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Charlie Swanson | Assignee: | Backlog - Query Team (Inactive) |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | optimization | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Assigned Teams: |
Query
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Participants: | |||||||||
| Description |
|
A Document and a BSONObj logically represent the same thing, but the aggregation framework works with Documents instead of BSONObjs, since the former are cheaper to manipulate. A MatchExpression (used in the $match stage) only accepts a BSONObj, via matchesBSON. This means that for the $match stage, we have to convert a Document to a BSONObj to determine if it matches. We should extend the MatchExpression class to be able to match a Document so we can avoid this potentially expensive conversion. |
| Comments |
| Comment by Charlie Swanson [ 08/Mar/16 ] |
|
I accidentally filed two tickets about this, |