0

What parameter needs to pass for the MongoEngine update_one() to get the updated document in return? Currently, it is returning 0 or 1.

chetan tamboli
  • 161
  • 2
  • 13

2 Answers2

1

Instead of using update_one() I used the method modify(). Pass the parameter new = True to it to get the updated result

chetan tamboli
  • 161
  • 2
  • 13
0

According to the mongoengine documentation there doesn't seem to be anything you can pass to update_one to return the updated document. I've tried this myself in a test environment and I'm also getting either a 0 or 1 returned.

There is a parameter you can pass to update called full_result which gives you a bit more information but it's nothing that would help you in this case.

A Random Guy
  • 167
  • 6