-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
const transaction = this.hashSearchResultCollection.updateTransaction(
{
data: result.data,
},
{
bestLeadingZeros: result.leadingZeros,
bestNum: result.num,
}
);
// would be nice to inline this
transaction.primaryOperation.condition.bestLeadingZeros = {
$lt: result.leadingZeros,
};
Additional note: this will unexpectedly throw "Entity not found" if the condition fails, rather than a condition check exception.
Proposed alternate format
this.hashSearchResultCollection.update({
key: { data: result.data },
update: {
bestLeadingZeros: result.leadingZeros,
bestNum: result.num,
},
condition: {
$lt: result.leadingZeros,
},
onConditionFail: THROW | RETURN_CURRENT
})
Metadata
Metadata
Assignees
Labels
No labels