Closed bmario closed 1 year ago
Merging #51 (fc3de19) into master (5a42ab9) will increase coverage by
0.03%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## master #51 +/- ##
==========================================
+ Coverage 97.15% 97.19% +0.03%
==========================================
Files 13 13
Lines 950 963 +13
==========================================
+ Hits 923 936 +13
Misses 27 27
Impacted Files | Coverage Δ | |
---|---|---|
aiocouch/document.py | 91.44% <100.00%> (+0.63%) |
:arrow_up: |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
Interesting! Is the goal to simplify aiocouch API?
_id
and _rev
are part of the real JSON structured returned by the CouchDB API, so I guess one can expect them to be present when querying document['_id']
.
My use case was I wanted to copy a document from one database to another under a new name. Hence I'd need to remove the _id
, and _rev
so I can write something like:
orig = await database1['doc_id']
copy = await database2['new_id']
copy.data = orig.data
await copy.save()
But I'm really torn on this one. Changing the semantics of data
is quite a change, and also, the new behavior has so many edge cases. In the meantime, I believe having an explicit method or property like dataWithoutInternal
would be better. So, this is still in limbo.
This changes the data property not to contain the internal CouchDB entries, i.e.,
_id
and_rev
. This is technically a breaking change, even though the old behavior wasn't adequately documented.