langchain/vectorstores/mongodb_atlas.py/MongoDBAtlasVectorSearch/from_texts
class MongoDBAtlasVectorSearch:    def from_texts(
        cls,
        texts: List[str],
        embedding: Embeddings,
        metadatas: Optional[List[dict]] = None,
        client: Optional[MongoClient] = None,
        namespace: Optional[str] = None,
        **kwargs: Any,
    ) -> MongoDBAtlasVectorSearch:
        """Construct MongoDBAtlasVectorSearch wrapper from raw documents.

        This is a user-friendly interface that:
            1. Embeds documents.
            2. Adds the documents to a provided MongoDB Atlas Vector Search index
                (Lucene)

        This is intended to be a quick way to get started.

        Example:
            .. code-block:: python
                from pymongo import MongoClient

                from langchain.vectorstores import MongoDBAtlasVectorSearch
                from langchain.embeddings import OpenAIEmbeddings

                client = MongoClient("<YOUR-CONNECTION-STRING>")
                namespace = "<db_name>.<collection_name>"
                embeddings = OpenAIEmbeddings()
                vectorstore = MongoDBAtlasVectorSearch.from_texts(
                    texts,
                    embeddings,
                    metadatas=metadatas,
                    client=client,
                    namespace=namespace
                )
        """
        if not client or not namespace:
            raise ValueError("Must provide 'client' and 'namespace' named parameters.")
        vecstore = cls(client, namespace, embedding, **kwargs)
        vecstore.add_texts(texts, metadatas=metadatas)
        return vecstore