-
Type:
New Feature
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Query Optimization
-
Fully Compatible
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Here is example of a query that a user may use today using $function. They need a way to get subtype using native agg.
db.aggregate([
{
'$documents': [
{
a: {
'$convert': {
input: 'hn3uUsMxSE6S0cVkebjmfg==',
to: { type: 'binData', subtype: 0 },
format: 'base64'
}
},
b: { '$toUUID': '867dee52-c331-484e-92d1-c56479b8e67e' }
}
]
},
{
'$set': {
a_subtype: {
'$function': {
body: 'function(uuid) { return uuid.type; }',
args: [ '$a' ],
lang: 'js'
}
},
b_subtype: {
'$function': {
body: 'function(uuid) { return uuid.type; }',
args: [ '$b' ],
lang: 'js'
}
}
}
}
])
>>
[
{
a: Binary.createFromBase64('hn3uUsMxSE6S0cVkebjmfg==', 0),
b: UUID('867dee52-c331-484e-92d1-c56479b8e67e'),
a_subtype: 0,
b_subtype: 4
}
]
- is depended on by
-
COMPASS-9668 Investigate changes in SERVER-103893: Expression to determine the subtype of BinData field
-
- Backlog
-