From 96d76961ee3ea2722434c8ded11e7dce41424846 Mon Sep 17 00:00:00 2001 From: Oleg Korol Date: Fri, 29 Nov 2024 14:22:25 +0400 Subject: [PATCH] v.1.0.3: Update docs --- README.md | 20 ++++++++------------ deno.json | 2 +- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 23b8b4e..dc030a5 100644 --- a/README.md +++ b/README.md @@ -169,20 +169,16 @@ Returns the updated document with an additional `_id` and `_path` fields. ## Using timestamps -Firestore timestamps are not implemented in this library. If you need to use -timestamps, here's how you can do it: - -```bash -deno add npm:firebase/firestore -``` - -...and then use the `Timestamp` class from the `firebase/firestore` package: +If you need to use Firestore timestamps, simply use `Date` objects, e.g.: ```typescript -import { Timestamp } from "npm:firebase/firestore"; +const now = new Date(); -// e.g. -const timestamp = Timestamp.now(); +// ...and then use it in your document: + +await firestore.createDocument("my-collection", { + createdAt: now, +}); ``` -> Note: The same principle applies to `UnionArray` field operations, etc. +The above will be converted to a Firestore timestamp automatically. diff --git a/deno.json b/deno.json index 39a327b..b176e12 100644 --- a/deno.json +++ b/deno.json @@ -1,6 +1,6 @@ { "name": "@koiztech/firestore-admin", - "version": "1.0.2", + "version": "1.0.3", "exports": "./mod.ts", "tasks": { "dev": "deno run --watch --env mod.ts",