rxdb
rxdb copied to clipboard
Error "Update expression must contain only one operator"
After update to v15, the following code started to throw an error:
DB_INSTANCE.my_collection.findOne({
selector: { /*...*/ },
}).update({
...data,
title: 'newTitle',
});
Error thrown:
Release note doesn't mention any change to the
update method.
Since v15 we use the mingo library for updates: https://github.com/kofrasa/mingo?tab=readme-ov-file#updating-documents
I do not think your given update statement is valid because it does not contain a $ operator.
Closing this. I think the correct call would be like:
DB_INSTANCE.my_collection.findOne({
selector: { /*...*/ },
}).update({
$set: {
...data,
title: 'newTitle',
}
});