Closed vipulkashyap111 closed 6 years ago
@jasonpet @rabbah This is for #112. Added putIfAbsent flag which if set to true along with overwrite=true will do an insertion operation if the document does not already exists(404)
Thanks for submitting the PR. Do you have an Apache ICLA on file? https://github.com/apache/incubator-openwhisk-package-cloudant/blob/master/CONTRIBUTING.md
It would be nice to add a unit test similar to the one here https://github.com/apache/incubator-openwhisk-package-cloudant/blob/master/tests/src/test/scala/system/packages/CloudantDatabaseActionsTests.scala#L290.
I can add a test and update the documentation. I will open a separate PR
Added a new variable to provide backward compatibility. I'll update the code as per @csantanapr review comments, do @jasonpet and @rabbah agree?
@csantanapr I generally agree the intended behavior is to just update. The concern was about breaking existing code.
There are create and update actions which do the more conservative behavior. So we can treat this as a bug, remove the parameter and just do the update on 404. I'm OK with that too.
I guess only a test is needed now since we are not adding a new parameter. No annotation updates in the install script or new documentation would be necessary.
Removed putIfAbsent flag, document is inserted if overwrite=true and it does not already exists in the database
@csantanapr changes updated, can you update your review?
… true