public Transaction.Result doTransaction(MutableData mutableData) { Post post = mutableData.getValue(Post.class); if (post != null) { // Update the starCount to be the same as the number of members in the stars map. if (post.stars != null) { post.starCount = post.stars.size(); } else { post.starCount = 0; } mutableData.setValue(post); return Transaction.success(mutableData); } else { return Transaction.success(mutableData); } }
} catch (Throwable e) { error = DatabaseError.fromException(e); result = Transaction.abort();
result = Transaction.abort();