Skip to content

Could I remove or insert documents while iterating the db? #484

Answered by msiemens
hao-lee asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @hao-lee, this is indeed allowed as TinyDB first reads the storage and then returns an iterator over all documents. The iterator will continue yielding the original set of documents, though. This means that any changes performed while iterating the list will not be represented in subsequent iterations.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by hao-lee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants