MongoEngine / MongoEngine/mongoengine
LazyReferenceField Passthrough Documentation
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.3k
- Forks
- 1.2k
- Avg merge
- 4h 41m
- Merged PRs (30d)
- 11
Description
Perhaps I have missed something here but as far as I can see there isn't much of an explanation about the use of passthrough=True for the LazyReferenceField.
As I understand it, if passthrough=False then accessing a field of the document the LazyReferenceField refers to will raise an exception. If passthrough=True, the document will be fetched when trying to access the field.
To me, passthrough=True sounds like the preferable behaviour. However, the fact that there is a parameter for passthrough at all and the fact that it defaults to False suggests there are some implications to setting it True.
What are the reasons to avoid setting passthrough=True? Are there any implications of doing so which I should be aware of?
The reason I ask this in an issue rather than somewhere like StackOverflow is it seems to me that the documentation could be clearer about this.
Thanks for your help!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the LazyReferenceField documentation and implementation, then trace how passthrough=False and passthrough=True behave when accessing fields on the referenced document. Document the reasons for the default, the implications of enabling passthrough, and any relevant query or performance considerations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mongodb, python
- Domain
- databases, documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100