Hello! I encountered an error while executing this MongoDB aggregation with nodejs:
[
{
"$match": {
"_id": {
"$in": <JavaScript array of billion ObjectId>
}
}
},
{
"$facet": {
"nbSession": [
{
"$group": {
"_id": "$sessionId"
}
},
{
"$count": "count"
}
],
"nbUser": [
{
"$group": {
"_id": "$userId"
}
},
{
"$count": "count"
}
]
}
}
]
The error I received is as follows:
RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0 && <= 17825792.
Could someone please help me understand and resolve this issue? Thank you in advance!