You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by sakam0to February 23, 2023
A snippt codes
from tinydb import TinyDB, Query
db = TinyDB("test.json")
db.insert({"id": 1})
q = Query()
records = db.search(q.id == 1)
records[0]["name"] = "N1"
db.search(q.id==1)
>>[{'id': 1, 'name': 'N1'}]
db.all()
>>[{'id': 1}]
You can see that modifications to the search function result affect the later search results. But it doesn't change the records on the disk. Is it expected or not?
The text was updated successfully, but these errors were encountered:
Discussed in #515
Originally posted by sakam0to February 23, 2023
A snippt codes
You can see that modifications to the search function result affect the later search results. But it doesn't change the records on the disk. Is it expected or not?
The text was updated successfully, but these errors were encountered: