-
Type:
New Feature
-
Resolution: Unresolved
-
Priority:
Unknown
-
None
-
Affects Version/s: None
-
Component/s: API Platform
-
None
In API Platform, the listing is done using a $facet stage in order to get the results and the count in a single read command.
Pipeline
[
{
"$sort": {
"_id": 1
}
},
{
"$facet": {
"results": [
{
"$skip": 0
},
{
"$limit": 30
}
],
"count": [
{
"$count": "count"
}
]
}
},
{
"$addFields": {
"__api_first_result__": {
"$literal": 0
},
"__api_max_results__": {
"$literal": 30
}
}
}
]
But mongocryptd does not support this stage.
mongocryptd error: Aggregation stage $internalFacetTeeConsumer is not allowed or supported with automatic encryption.
Similar error with lib mongo_crypt:
csfle "analyze_query" failed: Aggregation stage $internalFacetTeeConsumer is not allowed or supported with automatic encryption. [Error 2, code 31011]
Solutions:
- Enable support for $facet stage in mongocryptd and libmongocrypt
- Have an option to not use the $facet stage, maybe when using partial pagination without count.