Closed juanpujol closed 5 years ago
Can one of the admins verify this patch? To accept patch and trigger a build add comment ".ok\W+to\W+test."
@juanpujol thank you for the pull request!
I am personally not familiar with ES to judge whether this is a correct implementation.
The difference between updateAttributes
and replaceById
is that the first operation should perform a partial update (patch only the properties provided in the request, leave other properties untouched), while the second operation should replace the whole instance.
current instance:
{ "name": "Miroslav", "handle": "bajtos" }
updateAttributes({"name": "Miroslav Bajtos"})
results in { "name": "Miroslav Bajtos", "handle": "bajtos" }
replaceById({"name": "Alter Ego" })
results in { "name": "Alter Ego" }
(handle was removed)
@slnode ok to test
@bajtos thank you, that's a good observation.
Just updated the PR to use the index
API when calling replaceById
that should take care of the scenario you described.
@juanpujol - would you be able to contribute some tests as well? I can get you started via a skype session or something similar. PM me on gitter.im for my skype handle
This fixes the exeption when running:
POST /Model/{id}/replace
Error: The connector elasticsearch does not support replaceById operation. This is not a bug in LoopBack. Please contact the authors of the connector, preferably via GitHub issues.
closes #48