docs: def ensure_table(self, cls):
          """Required functionality."""
          coll_name = cls.get_table_name()
          try:
              db = self.mongo_client.get_default_database()
              db.create_collection(coll_name)
          except CollectionInvalid:
              pass  # Expected if collection already exists
  
          # Make sure we have indexes
          coll = self.get_collection(coll_name)
          for idx_name in cls.index_names():
              coll.ensure_index(idx_name)