From b3932aa54dc3ac45f663245a8bf876eb142e441c Mon Sep 17 00:00:00 2001 From: Fabian Stamm Date: Thu, 7 Nov 2019 00:18:15 +0100 Subject: [PATCH] Fixing wrong change type on set --- package.json | 2 +- src/database/query.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 449bac8..bd39cd7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hibas123/realtimedb", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "", "main": "lib/index.js", "private": true, diff --git a/src/database/query.ts b/src/database/query.ts index a62182a..4b56722 100644 --- a/src/database/query.ts +++ b/src/database/query.ts @@ -127,7 +127,7 @@ export class DocumentQuery extends Query { const lock = await this.database.locks.lock(collection, document); - let isNew = await this.database.data.get(this.getKey(collection, document)).catch(resNull).then(e => e !== null); + let isNew = !(await this.getDoc(collection, document)) return this.database.data .put(this.getKey(collection, document), encode(data))