Repository navigation
Conversation
Look in this case:
first_call = mongo_c.get_collection("collectionA").find_one({"search_field": "search_value"}, projection={"som_field":False})
second_call = mongo_c.get_collection("collectionA").find_one({"search_field": "search_value"}, projection={"som_field":False})
and there is an item with {"search_field": "search_value","some_filed":"abc","some_field2":{"inner_field1":"original value"}}.
if we will do something like:
first_call ["some_field2"]["inner_field1"] = "new_value"
we will change the value of the second_call too:
print(second_call ["some_field2"]["inner_field1"] )
>new_value
Codecov Report
@@ Coverage Diff @@
## develop #643 +/- ##
===========================================
- Coverage 95.38% 94.89% -0.49%
===========================================
Files 19 17 -2
Lines 3639 3290 -349
===========================================
- Hits 3471 3122 -349
Misses 168 168
Continue to review full report at Codecov.
|
pcorpet
requested changes
Jul 17, 2020
pcorpet
left a comment
Member
There was a problem hiding this comment.
Please split your commits in two different Pull Requests.
Also can you update the tests to add the code that shows that the previous code was wrong please?
added 4 commits
April 14, 2021 10:39
This was referenced May 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Look in this case:
first_call = mongo_c.get_collection("collectionA").find_one({"search_field": "search_value"}, projection={"som_field":False})
second_call = mongo_c.get_collection("collectionA").find_one({"search_field": "search_value"}, projection={"som_field":False})
and there is an item with {"search_field": "search_value","som_field":"abc","some_field2":{"inner_field1":"original value"}}.
if we will do something like:
first_call ["some_field2"]["inner_field1"] = "new_value"
we will change the value of the second_call too:
print(second_call ["some_field2"]["inner_field1"] )