When there are so much data you have to store, you don’t wanna store it by running the
call tinyDB store block. Therefore, the dictionary component comes in handy.
Dictionary is a built-in component.
Generally speaking, a dictionary uses a key to call and get the value.
It will return the string
a dictionary uses a key to call and get the value.
The same logic as TinyDB, but we use the dictionary this time
The dictionary now acts like tinyDB, which can be used to store almost every type of value.
Using the example above,
if the key doesn’t exist, return “not found”.
If you want to replace with/ add a new value, you can do the following.
Remember to store the dictionary in tinyDB as well.
Similar to storing a new value, but this creates a new pair of key and value.
There are also many features in the dictionary such as return the list of key and value, and more complex algorithm can be performed easily with dictionary.
If you find it helpful, kindly leave a like : )
Don’t hesitate to ask any questions, I will try to answer as much as I can.