Namespace management on an index host (serverless indexes): list, describe, create, and delete namespaces.

Functions

create-namespace

fn (host: Str, name: Str): Map
fn (host: Str, name: Str, schema: Map): Map
fn (host: Str, name: Str, schema: Map?, opts: Map): Map

POST {host}/namespaces - Create an empty namespace, optionally with a metadata schema ({fields: {genre: {filterable: true}}}) restricting which metadata fields are indexed. Namespaces are also created implicitly by the first upsert.

Example

host ::pinecone::indexes/describe-index("docs").host
::pinecone::namespaces/create-namespace(host, "guides", {fields: {source: {filterable: true}}})
Context Vars: pinecone.api.key

delete-namespace

fn (host: Str, namespace: Str): Any
fn (host: Str, namespace: Str, opts: Map): Any

DELETE {host}/namespaces/{namespace} - Delete a namespace and every record in it. Irreversible.

Example

host ::pinecone::indexes/describe-index("docs").host
::pinecone::namespaces/delete-namespace(host, "guides")
Context Vars: pinecone.api.key

describe-namespace

fn (host: Str, namespace: Str): Map
fn (host: Str, namespace: Str, opts: Map): Map

GET {host}/namespaces/{namespace} - One namespace: {name, record_count, schema?, indexed_fields?}.

Example

host ::pinecone::indexes/describe-index("docs").host
::pinecone::namespaces/describe-namespace(host, "guides").record_count
Context Vars: pinecone.api.key

list-namespaces

fn (host: Str): Map
fn (host: Str, options: Map): Map
fn (host: Str, options: Map, opts: Map): Map

GET {host}/namespaces - One page of namespaces. options: prefix, limit (default 100), paginationToken. Returns {namespaces: [{name, record_count}], pagination?: {next}, total_count}; record_count is a decimal string.

Example

host ::pinecone::indexes/describe-index("docs").host
out ::pinecone::namespaces/list-namespaces(host, {prefix: "tenant-", limit: 50})
map(out.namespaces, %.name)
Context Vars: pinecone.api.key