You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently trying to insert a new item into a ReferenceCollection of a User object (followers ex)
As the item I am inserting already exists, right now when I try to update() on the user object I am inserting to, it overrides the data for the referenced object. I am only initating the object with an ID for the document, so it sets all the fields to null.
If the update methods also updates the references, wouldn't that be inconvienient if the other object is updated in between, would mean the data would be rolled back?
if let userSnapshot = snapshot.documents.first
{
user.friends.insert(CHUser(id: id))
user.update({ (error) in
if let error = error
{
print(error)
completion(CHError.UnknownError, nil)
return
}
completion(nil, userSnapshot.documentID)
})
}
The text was updated successfully, but these errors were encountered:
Hello.
I am currently trying to insert a new item into a ReferenceCollection of a User object (followers ex)
As the item I am inserting already exists, right now when I try to update() on the user object I am inserting to, it overrides the data for the referenced object. I am only initating the object with an ID for the document, so it sets all the fields to null.
If the update methods also updates the references, wouldn't that be inconvienient if the other object is updated in between, would mean the data would be rolled back?
The text was updated successfully, but these errors were encountered: