Optimise the performance of Writethrough.put.

This commit is contained in:
Sam Rose 2023-12-14 16:20:31 +00:00
parent f462efa9b2
commit 7ec2c3860b
No known key found for this signature in database
1 changed files with 2 additions and 5 deletions

View File

@ -56,11 +56,8 @@ async function put(
const writeDb = async (toWrite: any) => {
// doc should contain the _id and _rev
const response = await db.put(toWrite, { force: true })
output = {
...doc,
_id: response.id,
_rev: response.rev,
}
output._id = response.id
output._rev = response.rev
}
try {
await writeDb(doc)