-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removing attributes with upsert #339
Comments
Definitely, I can't quite remember why I omitted that operation but I will take a look! |
Thank you! Your library has been very helpful to far! |
We've encountered the same issue, just today, as the OP has posted about. Upon reading the documentation, we first thought that the
And also, based on this, we thought that if there is no record in the db, new one will be created. That is true, BUT... it gets created without
So that's where we hit a roadblock. Then we came across
This brings some hope, are there any updates on this? |
Hi @rangoc I definitely owe this ticket an update; thank you for weighing in as well, it always helps with prioritization to know when multiple experience the same scenario. I apologize @mikeyaa that I have kept you waiting. I did start to look at this and found there was some hidden complexity with I can't really commit right now to how long this might take, we our first baby in February and that has definitely slowed down my updates in the short term. That said, I fold this need into the In the meantime, you might be able to get around this by avoiding the |
@tywalch Thanks for such a rapid feedback 🥇 And also congratulations on the baby! :) Our I'll try with the workaround, and see where it gets me! :) Thanks! |
Hmm... just now tested the workaround, doesn't seem to have any effect. How we decided to solve this for the time being, is by doing an additional query, querying for an item, and checking whether it already exists. If it does, we do an |
If you share your model I could put something more specific together for you, though here's an example of what I meant: The use of Depending on your model, this approach may/may not work well, but there could be other options depending on your specifics |
I'll also add there is also a I don't know your architecture obviously, but if you believe the item exists at the time of write, a |
@tywalch Sorry, just now seeing that you've replied. Thanks for trying to help! 🙌🏻 Here's the model:
Here's the model. |
Is it possible to remove attributes from a record while using
upsert
? I seeupdate
hasset()
andremove()
but how would I go about upserting a record that removes some properties in one go? It seems it will only set attributes but not unset them.The text was updated successfully, but these errors were encountered: