UBERF-5986: Upgrade fixes (#4957)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev
2024-03-14 11:24:25 +06:00
committed by GitHub
parent 768d57348b
commit 27e46ef3ae
7 changed files with 167 additions and 27 deletions
+3 -1
View File
@@ -183,7 +183,9 @@ export class MigrateClientImpl implements MigrationClient {
async create<T extends Doc>(domain: Domain, doc: T | T[]): Promise<void> {
if (Array.isArray(doc)) {
await this.db.collection(domain).insertMany(doc as Document[])
if (doc.length > 0) {
await this.db.collection(domain).insertMany(doc as Document[])
}
} else {
await this.db.collection(domain).insertOne(doc as Document)
}