Skip to content

Commit 25357a0

Browse files
authored
Merge pull request #270 from fummicc1/feature/fix-server-timestamp-documentation
Make documentation more understandable about `ServerTimeStamp` usage.
2 parents 4a1ba94 + 8997766 commit 25357a0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,13 @@ You can also omit the serializer but this is discouraged due to a [current limit
9393

9494
```kotlin
9595
@Serializable
96-
data class Post(val timestamp: Double = ServerValue.TIMESTAMP)
96+
data class Post(
97+
// In case using Realtime Database.
98+
val timestamp: Double = ServerValue.TIMESTAMP,
99+
// In case using Cloud Firestore.
100+
val timestamp: Double = FieldValue.serverTimestamp,
101+
)
102+
97103
```
98104

99105
<h3><a href="https://kotlinlang.org/docs/reference/functions.html#default-arguments">Default arguments</a></h3>

0 commit comments

Comments
 (0)