The following structure defines the SQL update syntax in LiteDB. Keyworks and function names are case-insensitive.
UPDATE <collection>
SET <key0> = <exprValue0> [,<keyN> = <exprValueN>] | <newDoc>
[ WHERE <filterExpr> ]
collectionis the name of the collection where the documents will be inserted.- Every
keyis the attribute name in the document and the correspondingexprValueis an expression that returns the desired value. For more info, see Expressions. newDocis a valid JSON object.- If the form
<key> = <exprValue>is used in theSETclause, the informed fields will be updated or created in every document returned by theWHEREclause. - If
newDocis used in theSETclause, the documents returned by theWHEREclause will be entirely replaced bynewDoc. filterExpris any valid filter expression. For more info, check Where clause