Answer the question
In order to leave comments, you need to log in
Why doesn't creating indexes in mongoose schema work?
I don’t understand what’s wrong, the created rule for adding indexes in the schema doesn’t work for some reason.
Start from the beginning
Delete all indexes in the popsts collection db.posts.dropIndexes()
Result of db.posts.getIndexes()
[
{
"v" : 2,
"key" : {
"_id" : 1
},
"name" : "_id_",
"ns" : "site.posts"
}
]
Executor error during find command: OperationFailed: Sort operation used more than the maximum 33554432 bytes of RAM. Add an index, or specify a smaller limit.
schema.index({indexAt: 1});
Executor error during find command: OperationFailed: Sort operation used more than the maximum 33554432 bytes of RAM. Add an index, or specify a smaller limit.
[
{
"v" : 2,
"key" : {
"_id" : 1
},
"name" : "_id_",
"ns" : "site.posts"
},
{
"v" : 2,
"unique" : true,
"key" : {
"url" : 1
},
"name" : "url_1",
"ns" : "site.posts",
"background" : true
},
{
"v" : 2,
"key" : {
"indexAt" : 1
},
"name" : "indexAt_1",
"ns" : "site.posts",
"background" : true
}
]
db.wallpapers.createIndex({'indexAt': 1})
Answer the question
In order to leave comments, you need to log in
If still relevant, then this error occurs due to the fact that there is not enough memory for the sort () operation. To increase its limit to 128MB, you can try this method:
> db.adminCommand({"setParameter": 1, "internalQueryExecMaxBlockingSortBytes" : 134217728})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question