Add createdAd and updatedAt on bulkDocs
This commit is contained in:
parent
e07bc5b572
commit
61d73b1f59
|
@ -308,8 +308,12 @@ export class DatabaseImpl implements Database {
|
||||||
}
|
}
|
||||||
|
|
||||||
async bulkDocs(documents: AnyDocument[]) {
|
async bulkDocs(documents: AnyDocument[]) {
|
||||||
|
const now = new Date().toISOString()
|
||||||
return this.performCall(db => {
|
return this.performCall(db => {
|
||||||
return () => db.bulk({ docs: documents })
|
return () =>
|
||||||
|
db.bulk({
|
||||||
|
docs: documents.map(d => ({ createdAt: now, ...d, updatedAt: now })),
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue