CouchbaseVectorList

List vector documents with optional filters for user, conversation, and metadata.

Syntax

couchbaseVectorList(
    cacheName,
    [userId],
    [conversationId],
    [metadata],
    [limit],
    [offset]
)

Parameters

Parameter
Type
Required
Default
Description

cacheName

String

Yes

-

Name of the cache configuration

userId

String

No

-

Filter by user ID

conversationId

String

No

-

Filter by conversation ID

metadata

Struct

No

-

Filter by metadata fields

limit

Number

No

100

Maximum number of results

offset

Number

No

0

Number of results to skip (pagination)

Returns

Returns an array of vector document structs, ordered by createdAt DESC. Each struct contains:

  • id - Document ID

  • type - Document type ("vector_document")

  • text - Text content

  • embedding - Vector embedding array

  • metadata - Custom metadata

  • userId - User ID (if set)

  • conversationId - Conversation ID (if set)

  • createdAt - Creation timestamp

  • updatedAt - Last update timestamp

Examples

List All Documents

List by User

List by Conversation

Filter by Metadata

Combined Filters

Pagination

List User's Recent Documents

List by Category

Get Conversation Participants

List with Statistics

Export User Data

Cleanup Old Documents

Build Document Index

Notes

  • Default ordering - Results are ordered by createdAt DESC (newest first)

  • Limit default - Default limit is 100 documents

  • AND filters - All specified filters must match (not OR)

  • Metadata matching - All specified metadata fields must match exactly

  • Case sensitivity - userId, conversationId, and metadata values are case-sensitive

  • Performance - Use limit and offset for large result sets

Pagination Pattern

Use Cases

  • 📝 User dashboards - Show user's documents

  • 💬 Conversation history - Display chat messages

  • 🗂️ Category browsing - List documents by category

  • 🔍 Content management - Browse and manage documents

  • 📊 Analytics - Analyze document metadata and patterns

  • 🗑️ Cleanup - Find and delete old documents

See Also

Last updated

Was this helpful?