Conversation
# Conflicts: # tests/testthat/test-doc_upsert.R
Codecov Report
@@ Coverage Diff @@
## master #69 +/- ##
==========================================
+ Coverage 40.61% 47.24% +6.63%
==========================================
Files 32 33 +1
Lines 426 436 +10
==========================================
+ Hits 173 206 +33
+ Misses 253 230 -23
Continue to review full report at Codecov.
|
|
thanks @critichu i'll have a look |
|
LGTM. The only thing that comes to mind: Currently |
|
Sounds good! |
it could be, i'll open an issue. for now I think we move on with this, and we can add support for other classes later |
Added a new function called
doc_upsert()that updates an existing document or creates it if it doesn't yet exist.Description
doc_upsert()first retrieves the latest revision number for a given document id (docid) -- usingdb_revisions()It then updates that document to the given
doc-- usingdoc_update()If the
dociddoes not exist, then the first step will fail.This is handled in
doc_upsert(), which reverts to creating the document -- usingdoc_create()Example
Tests
doc_upsert()is using existingsofafunctions.Nevertheless I included unit tests in the
tests/testthatfolder.