arkiv-sdk
    Preparing search index...

    Class Annotation<V>

    Generic annotation class for attaching metadata to Arkiv entities.

    Annotations provide a key-value mechanism for adding searchable metadata to entities, enabling efficient querying and categorization of stored data. They are essential for building database-like functionality on top of Arkiv.

    // String annotations for categorization
    const typeAnnotation = new Annotation("type", "user-profile");
    const statusAnnotation = new Annotation("status", "active");

    // Numeric annotations for indexing and filtering
    const priorityAnnotation = new Annotation("priority", 1);
    const timestampAnnotation = new Annotation("created_at", Date.now());

    Type Parameters

    • V

      The type of the annotation value (string, number, etc.)

    Index

    Constructors

    Properties

    Constructors

    • Create a new annotation with the specified key and value.

      Type Parameters

      • V

      Parameters

      • key: string

        The string identifier for this annotation

      • value: V

        The value to associate with the key

      Returns Annotation<V>

    Properties

    key: string

    The annotation key identifier

    value: V

    The annotation value