TinyDB tag update without deletion or overwrite

245 views
Skip to first unread message

sku...@gmail.com

unread,
May 1, 2014, 9:31:24 AM5/1/14
to mitappinv...@googlegroups.com
Hello again!

I am trying to update the list under a tag in the DB with a three item list, but it doesn't work.

As far as I can see, there is no way to update TinyDB without retrieving the data first, storing it in a list with the new data, clearing the tag in DB and storing the list. So, I came up with these blocks:

Two things:
  1. This doesn't look very good, feels like there should be another way of doing it.
  2. This seems to create an empty list and stores the data there:

Any ideas?

Taifun

unread,
May 1, 2014, 9:58:20 AM5/1/14
to mitappinv...@googlegroups.com
As far as I can see, there is no way to update TinyDB without retrieving the data first, 
so why don't you just do that?
why do you work with valueIfTagNotThere = "true"?
your screenshot from yesterday looked much better...

the first block should be to get the main list from TinyDB and assign it to the list variable
then you can check, if the list is empty and do the further processing

btw, you do not need the ClearTag block, if you save data in a tag, which is already stored in TinyDB, the data will be overwritten
Taifun




Taifun

unread,
May 1, 2014, 10:13:14 AM5/1/14
to mitappinv...@googlegroups.com
see screenshot
Taifun


sku...@gmail.com

unread,
May 1, 2014, 10:21:31 AM5/1/14
to mitappinv...@googlegroups.com
Taifun, you are a genius. By providing that screenshot you not only helped me fix the problem, but also taught me the concept of local variables. I know I should have read that but you've just helped me tremendously.

Thank you!
Reply all
Reply to author
Forward
0 new messages