TinyDB auto-delete function

Hi there, i wish to limit my TinyDb to have only 60 data entries. Everytime a new data key in, the old one will be deleted. Is it possible to do that? Below are my data view and blocks


After insert new data to tbData at index 1, check if the length of the tbData is >60. if yes, then delete index 61.

Yes, it is a Queue implimentation, as

Which one is "the old" ?

This seems to be a question of "FIFO" or "LIFO"

In this case, i am referring to FIFO.

1 Like

It is Queue.

It is Stack.

I don't understand. What do these terms ("queue / stack") have to do with my statement (link)?

Yes, that is also good to understand.. and here, these are just to orgnize data because of it nature, we can think of Queue at ticket window (first person in Q will be served first), and Stack of books (last book which was put on stack will be available to access first).

This (LIFO / FIFO) has nothing to do with queues and stacks, it's about how inventory is valued.

Sorry, I don't agree, since this is what, I had learned in my Data Structure Course,

and.. one thing can have many uses, not just accounting

2 Likes

Ok, so this view is all about the order in which data is handled/used. In this respect, a different approach from computer science, not from economics.
So probably more relevant here.

Btw, I don't have a computer science background / education (as my profile shows). :wink:

But I'm pretty sure the terms "LIFO/FIFO" originated in economics and were adopted (and redefined) in computer science.

1 Like