younifyd
Menu

Upsert records

Upsert records

POST/vectors/upsert

Use it in a workflow

  1. Add a step and choose the Pinecone connector.
  2. Pick the Upsert records action (under Data).
  3. Fill in the fields below, then reference the result from later steps as {{upsertRecords.response.data}}.

Request

Request body

Enter the body as JSON in the step's Body field.

vectorsarray<object>required

An array containing the vectors to upsert. Recommended batch limit is up to 1000 vectors.

idstringrequired

This is the vector's unique id.

valuesarray<number (float)>

This is the vector data. On a request it must be non-empty, and at least one value must have a magnitude of `1e-8` or greater — a vector whose values are all smaller than that is rejected as containing only zeros. On a response this is an empty array whenever the record has no dense data to return: on a sparse index, and on any index when values were not requested. The array is therefore not constrained here, because this schema describes both directions.

sparseValuesobject2 fields

Vector sparse data. Represented as a list of indices and a list of corresponded values, which must be with the same length.

metadataobject

This is the metadata included in the request. Field names may not begin with `$`, which is reserved for filter operators. Every other name is accepted, including names that are empty, non-ASCII, or begin with `_`.

namespacestring

The namespace where you upsert records.

json
{
  "vectors": [
    {
      "id": "example-vector-1",
      "values": [
        0.1,
        0.2,
        0.3,
        0.4,
        0.5,
        0.6,
        0.7,
        0.8
      ],
      "sparseValues": {
        "indices": [
          1,
          312,
          822,
          14,
          980
        ],
        "values": [
          0.1,
          0.2,
          0.3,
          0.4,
          0.5
        ]
      },
      "metadata": {
        "genre": "documentary",
        "year": 2019
      }
    }
  ],
  "namespace": "example-namespace"
}

Response

Returns 200 with an object. Read it in later steps with {{upsertRecords.response.data.<field>}}.

upsertedCountinteger (int64)

The number of vectors upserted.

json
{
  "upsertedCount": 2
}

Need more? See the Pinecone guide for connection setup and behaviour shared by every action.