This repository was archived by the owner on Oct 18, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-13
lines changed
Expand file tree Collapse file tree 2 files changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -169,20 +169,16 @@ Returns the updated document with an additional `_id` and `_path` fields.
169169
170170## Using timestamps
171171
172- Firestore timestamps are not implemented in this library. If you need to use
173- timestamps, here's how you can do it:
174-
175- ``` bash
176- deno add npm:firebase/firestore
177- ```
178-
179- ...and then use the ` Timestamp ` class from the ` firebase/firestore ` package:
172+ If you need to use Firestore timestamps, simply use ` Date ` objects, e.g.:
180173
181174``` typescript
182- import { Timestamp } from " npm:firebase/firestore " ;
175+ const now = new Date () ;
183176
184- // e.g.
185- const timestamp = Timestamp .now ();
177+ // ...and then use it in your document:
178+
179+ await firestore .createDocument (" my-collection" , {
180+ createdAt: now ,
181+ });
186182```
187183
188- > Note: The same principle applies to ` UnionArray ` field operations, etc .
184+ The above will be converted to a Firestore timestamp automatically .
Original file line number Diff line number Diff line change 11{
22 "name" : " @koiztech/firestore-admin" ,
3- "version" : " 1.0.2 " ,
3+ "version" : " 1.0.3 " ,
44 "exports" : " ./mod.ts" ,
55 "tasks" : {
66 "dev" : " deno run --watch --env mod.ts" ,
You can’t perform that action at this time.
0 commit comments