code: def map_size(self, key):
          
          # TODO: This should use get_count, but we need to check for compat
          # with server version (i.e. >= 4.6) first; otherwise it just
          # disconnects.
  
          rv = self.get(key)
          return len(rv.value)
docs: Get the number of items in the map.
  
          :param str key: The document ID of the map
          :return int: The number of items in the map
          :raise: :cb_exc:`NotFoundError` if the document does not exist.
  
          .. seealso:: :meth:`map_add`