Skip to content

ability to use allowDiskUse on mongo #7765

Open
@stewones

Description

@stewones
Contributor

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

parse-github-assistant commented on Jan 6, 2022

@parse-github-assistant

Thanks for opening this issue!

  • 🎉 We are excited about your ideas for improvement!
mtrezza

mtrezza commented on Jan 6, 2022

@mtrezza
Member

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

added
type:featureNew feature or improvement of existing feature
on Jan 6, 2022
stewones

stewones commented on Feb 1, 2022

@stewones
ContributorAuthor

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

mtrezza commented on Feb 6, 2022

@mtrezza
Member

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

aclec commented on May 5, 2022

@aclec

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

mtrezza

mtrezza commented on May 5, 2022

@mtrezza
Member

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

stewones

stewones commented on May 10, 2022

@stewones
ContributorAuthor

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

stewones commented on Nov 25, 2022

@stewones
ContributorAuthor

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

stewones

stewones commented on Nov 25, 2022

@stewones
ContributorAuthor

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

stewones

stewones commented on Nov 26, 2022

@stewones
Author
changed the title [-]ability to use allowDiskUse on mongo for find and count methods[/-] [+]ability to use allowDiskUse on mongo[/+] on Nov 26, 2022
mtrezza

mtrezza commented on Nov 26, 2022

@mtrezza
stewones

stewones commented on Nov 26, 2022

@stewones
Author
mtrezza

mtrezza commented on Nov 26, 2022

@mtrezza
aclec

aclec commented on Nov 26, 2022

@aclec

allowDiskUse is true by default in mongo 6.
If Parse let the default option, it will work with an upgrade of mongo version.

mtrezza

mtrezza commented on Nov 26, 2022

@mtrezza
Member

Maybe it still makes sense to add the option, as there will be deployments running on MongoDB <6 for a while, probably years?

stewones

stewones commented on Nov 27, 2022

@stewones
ContributorAuthor

created a draft. it already works with find

#8337

linked a pull request that will close this issue on Nov 27, 2022
suhailbw

suhailbw commented on Dec 30, 2022

@suhailbw

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

mtrezza commented on Dec 31, 2022

@mtrezza
Member

Could you explain a bit more?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:featureNew feature or improvement of existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @stewones@mtrezza@aclec@suhailbw

      Issue actions

        ability to use allowDiskUse on mongo · Issue #7765 · parse-community/parse-server