I'm using Firestore for my project, and I've noticed that for some reason, the data stored in my db has the "is" removed from the key. Here is my model in Kotlin:
@Serializable
data class Transaction internal constructor(
val projectId: String = "",
val amount: Double = 0.0,
val currency: String = "USD",
val isRefund: Boolean = false,
) {
@Serializable(with = InstantSerializer::class)
val createdAt: Instant = Instant.now()
// This is a lib and I want the consumer to use this instead of the constructor with default values
companion object {
fun new(
projectId: String,
amount: Double,
currency: String,
isRefund: Boolean
): Transaction {
return Transaction(
projectId = projectId,
amount = amount,
currency = currency,
isRefund = isRefund
)
}
}
}
In the db, it's being saved as refund. I searched my entire project, and there is no string refund (case-sensitive) at all. Is this a known behavior?
I'm setting the data using DocumentReference.set