Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ability to use allowDiskUse on mongo #7765

Open
3 tasks done
stewones opened this issue Jan 6, 2022 · 18 comments · May be fixed by #8337
Open
3 tasks done

ability to use allowDiskUse on mongo #7765

stewones opened this issue Jan 6, 2022 · 18 comments · May be fixed by #8337
Labels
type:feature New feature or improvement of existing feature

Comments

@stewones
Copy link
Contributor

stewones commented Jan 6, 2022

New Feature / Enhancement Checklist

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

@parse-github-assistant
Copy link

parse-github-assistant bot commented Jan 6, 2022

Thanks for opening this issue!

  • 🎉 We are excited about your ideas for improvement!

@mtrezza
Copy link
Member

mtrezza commented Jan 6, 2022

That sounds like a good addition, allowDiskUse has been added in MongoDB 4.4.

@mtrezza mtrezza added the type:feature New feature or improvement of existing feature label Jan 6, 2022
@stewones
Copy link
Contributor Author

stewones commented 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
Copy link
Member

mtrezza commented 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 at Parse.Query.readPreference for how an option is passed to the driver. You would basically replicate that and rename it Parse.Query.allowDiskUse.

@aclec
Copy link

aclec commented May 5, 2022

Hello @stewones can you implement it for aggregates too?
Otherwise I will do it later.

@mtrezza
Copy link
Member

mtrezza commented May 5, 2022

It seems that no PR has ever been submitted for this issue, so feel free to submit one.

@stewones
Copy link
Contributor Author

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
Copy link
Contributor Author

alright I need this for a pet project now, looking into 👀

@stewones
Copy link
Contributor Author

got it working for the find method, now need to add tests and support aggregate as well.
PR coming in a few hours 🫡

@stewones

This comment was marked as off-topic.

@stewones stewones changed the title ability to use allowDiskUse on mongo for find and count methods ability to use allowDiskUse on mongo Nov 26, 2022
@mtrezza

This comment was marked as off-topic.

@stewones

This comment was marked as off-topic.

@mtrezza

This comment was marked as off-topic.

@aclec
Copy link

aclec commented 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
Copy link
Member

mtrezza commented 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
Copy link
Contributor Author

created a draft. it already works with find

#8337

@suhailbw
Copy link

That sounds like a good addition, allowDiskUse has been added in MongoDB 4.4.

Do not think, this included the aggregation queries. It only mentions the find and the sort operation.

@mtrezza
Copy link
Member

mtrezza commented Dec 31, 2022

Could you explain a bit more?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New feature or improvement of existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants