Add create_or_replace like method
For many use cases I find myself wanting to have a sort of create or replace kind of method when writing records to Weaviate. I don't know if it is an explicit design choice to not include this in the API, but if you would be open to it I would be happy to contribute it.
Hi @FlorisHoogenboom,
The current create already works as an add_or_replace. Weaviate automatically updates entries that already exist and there is nothing to do from the client side.
Hi @dirkkul, I'm experiencing different behaviour though. Also judging from this section it seems that the current create does not function as an add or replace?
https://github.com/semi-technologies/weaviate-python-client/blob/572a9d401eda68bc17a9f6e876f996ac6d1a9213/weaviate/data/crud_data.py#L139
Am I missing a sort of global configuration option?
Hi @FlorisHoogenboom ,
ahh you're right. I was thinking about batches. There, existing objects are replaced. (If you add a lot of objects I'd recommend using batches instead of adding single objects)
Then I don't see any reason against having a create_or_replace function, @StefanBogdan are you ok with that?
I am for it, but I think it should be on the Server side not on the client side. As a temporary solution we could implement such a method.