[SERVER-13593] aggfmk $match operator support for nested field matching Created: 15/Apr/14  Updated: 15/Apr/14  Resolved: 15/Apr/14

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: 2.6.0-rc3
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: Norberto Fernando Rocha Leite (Inactive) Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

Currently it is not possible from a simple $match query on the aggregation framework to match fields of a document that might contain the same value:

test> db.example.insert( { 'colour': 'BLUE', 'color': 'BLUE'   }   )
Inserted 1 record(s) in 157ms
WriteResult({
  "nInserted": 1
})
test> db.example.aggregate( {$match:{ "colour": "$color"  }  })
{
  "result": [ ],
  "ok": 1
}

given the semantics of the "$" operator we should be able to support it.



 Comments   
Comment by Asya Kamsky [ 15/Apr/14 ]

functionally a dup of SERVER-2702

Comment by Asya Kamsky [ 15/Apr/14 ]

This is absolutely possible in agg framework but not in $match phase - match is limited by the same criteria find uses - you cannot compare a field to another field in a document in find().

In aggregation you can do this via $project using compare to generate a new field on which you can then match, otherwise this is a dupe of SERVER-2702

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