Hi sam,
I tried with the increment suggestion. my code looks like,
docRef := client.Collection(Collection).Doc(10)).Collection(number).Doc(Id)
var err error
if strings.EqualFold(deletedFieldValue, "0") {
_, err = docRef.Update(ctx, []firestore.Update{
{Path: "Payload.StopCount", Value: firestore.Increment(1)},
})
}
if strings.EqualFold(deletedFieldValue, "1") {
_, err = docRef.Update(ctx, []firestore.Update{
{Path: "Payload.StopCount", Value: firestore.Increment(-1)},
})
}
On frequent doc creation the stop count is inconsistent.