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

Add optional session parameter to Document.save #1839 #2061

Closed
wants to merge 4 commits into from
Closed

Add optional session parameter to Document.save #1839 #2061

wants to merge 4 commits into from

Conversation

george-pearson
Copy link

  • Added an optional session parameter to Document.save method.
  • Added a test to ensure the session parameter allows documents to be saved.

Session was added in MongoDB v3.6.0.

This pull request goes some of the way towards supporting MongoDB 4.0 transactions, issue #1839.

@george-pearson
Copy link
Author

george-pearson commented May 24, 2019

Aha hmm maybe this pull request is not that useful as it breaks for PyMongo <= 3.6.0 and mongoengine still supports PyMongo 3.5. I'll strip out the first commit and reopen that as a pull request on its own seeing as that could still be useful.

@mzamanzadeh
Copy link

mzamanzadeh commented Aug 20, 2019

hi!

why you don't add an if statement for backward compatibility? I mean some thing like this

if pyMongo.__version__ <= "3.6.0":
     raise Exception
<your contribution>

please add session and transaction support. I really need this :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants