1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15- # [START fs_counter_classes_async]
1615# [START firestore_solution_sharded_counter_custom_type_async]
1716import random
1817
@@ -44,9 +43,7 @@ def __init__(self, num_shards):
4443 self ._num_shards = num_shards
4544
4645 # [END firestore_solution_sharded_counter_custom_type_async]
47- # [END fs_counter_classes_async]
4846
49- # [START fs_create_counter_async]
5047 # [START firestore_solution_sharded_counter_create_async]
5148 async def init_counter (self , doc_ref ):
5249 """
@@ -61,9 +58,7 @@ async def init_counter(self, doc_ref):
6158 await col_ref .document (str (num )).set (shard .to_dict ())
6259
6360 # [END firestore_solution_sharded_counter_create_async]
64- # [END fs_create_counter_async]
6561
66- # [START fs_increment_counter_async]
6762 # [START firestore_solution_sharded_counter_increment_async]
6863 async def increment_counter (self , doc_ref ):
6964 """Increment a randomly picked shard."""
@@ -73,9 +68,7 @@ async def increment_counter(self, doc_ref):
7368 return await shard_ref .update ({"count" : firestore .Increment (1 )})
7469
7570 # [END firestore_solution_sharded_counter_increment_async]
76- # [END fs_increment_counter_async]
7771
78- # [START fs_get_count_async]
7972 # [START firestore_solution_sharded_counter_get_async]
8073 async def get_count (self , doc_ref ):
8174 """Return a total count across all shards."""
@@ -86,4 +79,3 @@ async def get_count(self, doc_ref):
8679 return total
8780
8881 # [END firestore_solution_sharded_counter_get_async]
89- # [END fs_get_count_async]
0 commit comments