async def aget_messages(self, key: str) -> List[ChatMessage]:
        """
        Get messages for a key asynchronously.

        Args:
            key: Key to get messages for

        """
        # Find all messages for this key, sorted by index
        cursor = self._async_collection.find({"session_id": key}).sort("index", 1)

        # Convert to list and then to ChatMessage objects
        docs = await cursor.to_list(length=None)
        return [_dict_to_message(doc["message"]) for doc in docs]

        Get messages for a key asynchronously.

        Args:
            key: Key to get messages for

        
llama-index-integrations/storage/chat_store/llama-index-storage-chat-store-mongo/llama_index/storage/chat_store/mongo/base.py