from lambdadb import LambdaDB lambda_db = LambdaDB( server_url="PROJECT_URL", project_api_key="YOUR_API_KEY" ) get_bulk_upsert = lambda_db.collections.docs.get_bulk_upsert( collection_name=collection_name )
{ "url": "<string>", "type": "application/json", "httpMethod": "PUT", "objectKey": "<string>", "sizeLimitBytes": 209715200 }
bulk-upsert
objectKey
import json import requests docs = [ { "id": "bulk_33201222", "url": "https://en.wikipedia.org/wiki/LambdaDB", "title": "LambdaDB", "text": "LambdaDB is a serverless-native search engine for AI... ", "dense_vector": [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0], "sparse_vector": {"LambdaDB": 0.83, "is": 0.1, "a": 0.1, "AI": 0.7} } ] # Upload documents to the provided URL put_documents = requests.put( get_bulk_upsert.url, data=json.dumps({"docs": docs}), headers={"Content-Type": "application/json"}, ) # Execute bulk upsert bulk_upsert = lambda_db.collections.docs.bulk_upsert( collection_name=collection_name, object_key=get_bulk_upsert.object_key )
{ "message": "Bulk upsert request is accepted" }
Was this page helpful?