Add support for passing options
(or mongodb
) to all methods.
#189
Add support for passing options
(or mongodb
) to all methods.
#189
Conversation
Previously only methods that allowed the `multi` option supported additional passed option. That change adds support for all other methods, ultimately calling e.g. `find`, `findAndModify`
Please note, the linter flags a line of code unchanged by this pull request:
|
This looks great and would be a big help when doing transactions. What are the next steps to get this merged @daffl? |
optoins
(or mongodb
) to all methods.options
(or mongodb
) to all methods.
Great, I was about to push a pull request with similar code. One thing that I did differently was to not pass options to estimatedDocumentCount and countDocuments. They don't have any session parameter. But all monodb operations have slightly different options. Have you tried to see what happens if for example countDocuments will get options.session? Will it just nicely ignore it? Some links to documentation. |
This looks cool! I am not a maintainer, but I do contribute often to the DB adapters. I would suggest modifying your code such that it does not change the |
Yes, this makes sense, thank you for the for the pull request @rudolph9. This features needs to be added to the documentation in the Readme, other than that it looks good to me. |
Good thing to point out. It appears to ignore the |
Documents how to utilized transaction and provides an example. js syntax, and fixed example code
@daffl Added documentation to the README.md. Please let me know if there are any other changes you would like to see. |
Looks great. The only other question I had was if there is a reason to have two ways for passing it (via |
I agree, I think we want In any case, I defer to you to decide how to move forward? |
I think that makes sense. Released as v6.3.0, thank you again! |
Previously only methods that allowed the
multi
option supportedadditional passed option. That change adds support for all other
methods, ultimately calling e.g.
find
,findAndModify
This indirectly address #127 as a MongoDB
session
can be viaoptions
(ormongodb
). Allowing the user to do something like the following: