Hello, I am attempting to add some metadata about my user to the documents I am uploading to mongo. I have access to the user's information, I just don't know how to add this information to the document. I imagine that I may be able to do this via the
SimpleNodeParser
. This what I have so far to store my data in mongo and create my index.
if is_user():
storage_context = StorageContext.from_defaults(
docstore=MongoDocumentStore.from_uri(uri=MONGO_URI),
index_store=MongoIndexStore.from_uri(uri=MONGO_URI),
)
parser = SimpleNodeParser()
nodes = parser.get_nodes_from_documents(documents)
storage_context.docstore.add_documents(nodes)
index = VectorStoreIndex(
nodes, storage_context=storage_context)