How can i search data with using "doc_id < 5"??? #549
Replies: 2 comments
-
What is the code you are working with? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Here I am assuming that "doc_id" is a field in your data, and not the database table's id's. based on the official docs: https://tinydb.readthedocs.io/en/latest/usage.html#queries from tinydb import TinyDB, Query
# Create or load the TinyDB database
db = TinyDB('db.json')
# Define the Query object
query = Query()
# Search for data where doc_id is less than 5
result = db.search(query.doc_id < 5)
# Print the result
print(result) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
How can i search data with using "doc_id < 5"???
Beta Was this translation helpful? Give feedback.
All reactions