TinyDB – Retrieving Data After creating a database, we need to frequently retrieve the data from that database. Following are the ways by which we can reterive the data from a database − The len() Query With the help of this query, we can get the number of documents in a database. Its syntax is […]
TinyDB – Upserting Data We discussed the update and insert queries, but sometimes, we a need a mix of both update and insert. In such cases, TinyDB provides a unique upsert query. This query helps us to insert and update data at a time as per the condition. It works in two ways − If […]
TinyDB – Modifying the Data We have already discussed the update query with the help of which we can modify the values as well as handle the data in our database. But the update query such as db.update(fields, query) allows us to update a document by adding or overwriting its values. But sometimes, we would […]