query sql is this
db.test_alarm.aggregate([{
$lookup:
{
from: "number_sum",
localField: "number",
foreignField: "compress_number",
as: "compress_counts"
}
}, {
$match:
{
"alarmRule":
{
"$ne": "1"
}
,
"username": "admin"
}
}, {
$sort :
{
"create_time": -1
}
}
])
If you remove the sorting, you can query the data normally,like this:
db.test_alarm.aggregate([
{ $lookup:
{ from: "number_sum", localField: "number", foreignField: "compress_number", as: "compress_counts"
}
},
{ $match: {
"alarmRule":
{
"$ne": "1"
}
,
"username": "admin"
}
},
])
So I think it’s a sort of problem,I tested in another environment, if the query exceeds the query cache, an error will be reported:out of query cache tell me try add {allowDiskUse: true},if i add it,sql will always run
but i add {allowDiskUse: true} to report error environment,The error is still “all indexes on collection dropped”
Please help me to solve this problem ,Thank you very very much
or tell me the logic of this sort sorting, under which circumstances it will report an error
My English is bad, please forgive me sorry!