-
Notifications
You must be signed in to change notification settings - Fork 1.4k
How to use allowDiskUse: true? #541
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
Comments
Dupe of #491. Not supported, but would be easy to add as an option in \Jenssegers\Mongodb\Query\Builder::getFresh. |
Having the same issue! @hackel do you mean it'd be an easy fix on jenssegers end or would anyone be able to add code into their app for it to work? If the latter, could you explain how? |
@chloealee You would have to fork it and modify the getFresh method. This is where MongoCollection::aggregate() is called, and allowDiskUse needs to be passed as an option there. If you don't want to bother with forking, you can just create a raw query with the raw() method. |
@hackel great, thanks! |
@hackel still having some trouble - tried to insert it into my raw query (below) but getting this error:
do you know what I'm doing wrong? |
I see what I did wrong now! If anyone is having this issue too and needs an example, got this to work:
The issue was that it thought 'allowDiskUse' was a pipeline stage name so I had to separate it out even further from the query. |
How would you go about passing in values from outside $duplicates, such as an array to compare. |
I think you'd want to do that after you find all of the $duplicates instead of passing through - just compare with the results in the array that gets returned. |
Yeah, but the index filtering results before they are returned would be a lot quicker |
I'm not quite sure - sorry @ScottSpittle ! |
@chloealee No worries, Thanks anyway. |
* github.com:moloquent/moloquent: Allow setting custom options on a query [Fixes mongodb#541]
@sparrowbear @chloealee Thanks to @hackel :) |
Not sure if I am in the right place for this, I am attempting to add the AllowDiskUse option invoking the options function, it doesn't seem to be handling it. Is AllowDiskUse usable outside of a raw query?
|
@Puggers Can you please change |
@amjad-eremnews The power of cases... yup that did it. Thanks! |
Help me,
How can I use 'allowDiskUse: true' in my model query?
The text was updated successfully, but these errors were encountered: