Open
Description
New Feature / Enhancement Checklist
- I am not disclosing a vulnerability.I am not just asking a question.I have searched through existing issues.
Current Limitation
currently it's not possible to set allowDiskUse
as option to queries
Feature / Enhancement Description
according to this comment, starting with mongo v5.12.8 it would be possible to pass allowDiskUse
through setOptions
Automattic/mongoose#10177 (comment)
await Test.find().sort({ name: 1 }).setOptions({ allowDiskUse: true }).exec();
Example Use Case
query.find({ allowDiskUse: true }).then(function(results) {
// Request succeeded
}, function(error) {
// Request failed
});
Alternatives / Workarounds
N/A
3rd Party References
N/A
Activity
parse-github-assistant commentedon Jan 6, 2022
Thanks for opening this issue!
mtrezza commentedon Jan 6, 2022
That sounds like a good addition,
allowDiskUse
has been added in MongoDB 4.4.stewones commentedon Feb 1, 2022
Yo @mtrezza
Do you think that would be too crazy to implement? I'm willing to set up parse for dev and have a shot
mtrezza commentedon Feb 6, 2022
I think it would be straight forward to implement. It's just another option that can be passed in
Parse.Query
which is then passed through to the MongoDB driver. You could take a look atParse.Query.readPreference
for how an option is passed to the driver. You would basically replicate that and rename itParse.Query.allowDiskUse
.aclec commentedon May 5, 2022
Hello @stewones can you implement it for aggregates too?
Otherwise I will do it later.
mtrezza commentedon May 5, 2022
It seems that no PR has ever been submitted for this issue, so feel free to submit one.
stewones commentedon May 10, 2022
hey guys, I've left the company I was working for which would benefit from this feature, so completely lost the interest for now. but would love to see this feature added.
stewones commentedon Nov 25, 2022
alright I need this for a pet project now, looking into 👀
stewones commentedon Nov 25, 2022
got it working for the
find
method, now need to add tests and supportaggregate
as well.PR coming in a few hours 🫡
stewones commentedon Nov 26, 2022
[-]ability to use allowDiskUse on mongo for find and count methods[/-][+]ability to use allowDiskUse on mongo[/+]mtrezza commentedon Nov 26, 2022
stewones commentedon Nov 26, 2022
mtrezza commentedon Nov 26, 2022
aclec commentedon Nov 26, 2022
allowDiskUse is true by default in mongo 6.
If Parse let the default option, it will work with an upgrade of mongo version.
mtrezza commentedon Nov 26, 2022
Maybe it still makes sense to add the option, as there will be deployments running on MongoDB <6 for a while, probably years?
stewones commentedon Nov 27, 2022
created a draft. it already works with
find
#8337
suhailbw commentedon Dec 30, 2022
Do not think, this included the aggregation queries. It only mentions the
find
and thesort
operation.mtrezza commentedon Dec 31, 2022
Could you explain a bit more?