# upsert_datapoints

> **Function** in `langchain_google_vertexai`

📖 [View in docs](https://reference.langchain.com/python/langchain-google-vertexai/vectorstores/_v2_operations/upsert_datapoints)

Upserts data points into a Vertex AI Vector Search 2.0 Collection.

## Signature

```python
upsert_datapoints(
    project_id: str,
    region: str,
    collection: str,
    ids: List[str],
    embeddings: List[List[float]],
    metadatas: List[dict] | None = None,
    credentials: Optional[Credentials] = None,
    vector_field_name: str = 'embedding',
    sparse_embeddings: List[dict[str, List[int] | List[float]]] | None = None,
) -> None
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `project_id` | `str` | Yes | The GCP project ID. |
| `region` | `str` | Yes | The GCP region. |
| `collection` | `str` | Yes | The resource name of the collection. |
| `ids` | `List[str]` | Yes | List of datapoint IDs. |
| `embeddings` | `List[List[float]]` | Yes | List of embedding vectors. |
| `metadatas` | `List[dict] \| None` | No | Optional list of metadata dictionaries. (default: `None`) |
| `credentials` | `Optional[Credentials]` | No | Optional credentials to use. (default: `None`) |
| `vector_field_name` | `str` | No | Name of the vector field in the collection schema. (default: `'embedding'`) |
| `sparse_embeddings` | `List[dict[str, List[int] \| List[float]]] \| None` | No | Optional list of sparse embedding dictionaries. (default: `None`) |

---

[View source on GitHub](https://github.com/langchain-ai/langchain-google/blob/982e4015b249de8b9ba1e787746d8cc1f6d6b790/libs/vertexai/langchain_google_vertexai/vectorstores/_v2_operations.py#L40)