Google News
logo
TinyDB - Quiz(MCQ)
What is the syntax for updating a document in a TinyDB database based on a specific criteria?
A)
updateDocument({field1: value1}, {field2: value2})
B)
modifyDocument({field1: value1}, {field2: value2})
C)
changeDocument({field1: value1}, {field2: value2})
D)
updateDocuments({field1: value1}, {field2: value2})

Correct Answer :   updateDocument({field1: value1}, {field2: value2})


Explanation : To update a document in a TinyDB database based on a specific criteria, developers can use the updateDocument() function and pass in two dictionary objects – one containing the search criteria and the other containing the updated data fields and their values.

Advertisement