@oxia-db/client - v0.1.0
    Preparing search index...

    Interface PutOptions

    Options for OxiaClient.put.

    interface PutOptions {
        partitionKey?: string;
        expectedVersionId?: number;
        ephemeral?: boolean;
        secondaryIndexes?: Record<string, string>;
        sequenceKeysDeltas?: number[];
    }
    Index

    Properties

    partitionKey?: string

    Override shard routing: records sharing the same partitionKey are co-located on the same shard regardless of their record keys.

    expectedVersionId?: number

    Make the write conditional on the current server-side version. Pass EXPECTED_RECORD_DOES_NOT_EXIST to assert the key is new. If the server's version does not match, the put fails with UnexpectedVersionIdError.

    ephemeral?: boolean

    If true, the record is tied to this client's session on its shard and is automatically removed when the session closes or expires.

    secondaryIndexes?: Record<string, string>

    Secondary index entries to attach to the record, as { indexName: secondaryKey }. The entries stay in sync with the record: overwrites replace the old secondary keys, and deletes remove them.

    sequenceKeysDeltas?: number[]

    Request server-assigned sequential suffixes for the key. Each delta advances a server-maintained counter (one counter per level of nesting) and produces zero-padded suffix(es) joined with -. Requires partitionKey and is incompatible with expectedVersionId.

    // first put  -> key "a-00000000000000000001"
    // second put -> key "a-00000000000000000002"
    await client.put('a', 'v', { sequenceKeysDeltas: [1], partitionKey: 'p' });