mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-07 10:17:42 +02:00
UBERF-5986: Upgrade fixes (#4957)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user