MongoEngine / MongoEngine/mongoengine

behaviour of Document.save with force_insert=False

Open
#2,491 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
4.3k
Forks
1.2k
Avg merge
4h 41m
Merged PRs (30d)
11

Description

Hi,
I am looking at the docs about Document.save here

https://docs.mongoengine.org/apireference.html#mongoengine.Document.save

It states that if a doc does not exists it will be created. However, given that force_insert is by default False, I would claim that the default behaviour is only to create a doc.

Moreover, what does this method throw/return?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Document.save API reference at docs.mongoengine.org/apireference.html#mongoengine.Document.save and inspect the documented force_insert behavior. Verify what the method returns and raises, then update the reference so creation and update behavior and the outcome of the call are clear.

Written by the indexing model from the issue text.

Assessment

Tech stack
mongodb, python
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.