Skip to content

Releases: ravendb/ravendb-nodejs-client

7.2.0

05 Feb 12:42
a3fbe97

Choose a tag to compare

🎉 What's New

☁️ Remote Attachments Support

Store attachments in cloud storage (Amazon S3 or Azure Blob Storage) to reduce database size and improve performance.

New Configuration System

  • Remote Attachments Configuration: Configure cloud storage destinations for automatic attachment uploads
    • Support for Amazon S3 with access keys, session tokens, and region configuration
    • Support for Azure Blob Storage with account key or SAS token authentication
    • S3-compatible storage service support (MinIO, Wasabi, DigitalOcean Spaces)
    • Path-style and virtual-hosted-style request options
    • Per-destination enable/disable control
    • Upload frequency, batch size, and concurrency configuration

Remote Attachment Operations

  • ConfigureRemoteAttachmentsOperation: Configure cloud storage destinations
  • GetRemoteAttachmentsConfigurationOperation: Retrieve current configuration
  • Full support in bulk insert and regular session operations

Cloud Storage Settings Classes

  • RemoteAttachmentsConfiguration: Main configuration container
  • RemoteAttachmentsDestinationConfiguration: Individual destination settings
  • RemoteAttachmentsS3Settings: Amazon S3 configuration
  • RemoteAttachmentsAzureSettings: Azure Blob Storage configuration
  • RemoteAttachmentParameters: Schedule attachment uploads to cloud storage

✅ Schema Validation Support

Enforce JSON Schema validation on document collections to ensure data quality.

Schema Validation Configuration

  • Schema Validation Setup: Define and manage JSON Schema validators per collection
  • Disable/enable validation per collection without removing configuration
  • Support for complex nested schemas with constraints

Schema Validation Operations

  • ConfigureSchemaValidationOperation: Apply schema validation configuration
  • GetSchemaValidationConfiguration: Retrieve current validation settings

Schema Features

  • JSON Schema support (type checking, required fields, min/max values, patterns, etc.)
  • Per-collection configuration with optional disable flag
  • Backward compatible - validation can be toggled on/off

🔧 Enhanced API

New Attachment Parameter Classes

  • StoreAttachmentParameters: Encapsulates all attachment storage options
    • Name, stream, content type, change vector, and remote parameters
    • Convenient builder pattern alternative to multiple method overloads
  • IStoreAttachmentParameters: Interface for attachment storage parameters
  • RemoteAttachmentFlags: Type-safe flags for remote attachment behavior
  • RemoteAttachmentParameters: Configure remote uploads with optional scheduling

Updated Attachment Interface

  • Attachment metadata now includes optional remoteParameters
  • Enhanced AttachmentDetails with remote parameter information
  • Full attachment metadata serialization/deserialization support

API Method Overloads

  • Session attachment storage now supports both traditional and parameter-based approaches:
    // Traditional approach (still supported)
    session.advanced.attachments.store(docId, name, stream, contentType);
    
    // New parameter-based approach
    session.advanced.attachments.store(docId, new StoreAttachmentParameters(...));
  • Bulk insert attachment support includes remote parameters

🔄 Breaking Changes

None - This release maintains full backward compatibility.

📖 Usage Examples

Configuring Remote Attachments with S3

import { 
    ConfigureRemoteAttachmentsOperation,
    RemoteAttachmentsConfiguration,
    RemoteAttachmentsDestinationConfiguration,
    RemoteAttachmentsS3Settings
} from "ravendb";

const configuration = new RemoteAttachmentsConfiguration();

const s3Destination = new RemoteAttachmentsDestinationConfiguration();
s3Destination.disabled = false;

const s3Settings = new RemoteAttachmentsS3Settings();
s3Settings.bucketName = "my-attachments-bucket";
s3Settings.awsAccessKey = "YOUR_ACCESS_KEY";
s3Settings.awsSecretKey = "YOUR_SECRET_KEY";
s3Settings.awsRegionName = "us-east-1";

s3Destination.s3Settings = s3Settings;
configuration.destinations["MyS3Storage"] = s3Destination;

await store.maintenance.send(new ConfigureRemoteAttachmentsOperation(configuration));

Configuring Remote Attachments with Azure

import {
    RemoteAttachmentsAzureSettings
} from "ravendb";

const azureSettings = new RemoteAttachmentsAzureSettings();
azureSettings.storageContainer = "my-container";
azureSettings.accountName = "myStorageAccount";
azureSettings.accountKey = "YOUR_ACCOUNT_KEY"; // Or use sasToken for SAS-based auth
azureSettings.remoteFolderName = "production/database1";

azureDestination.azureSettings = azureSettings;

Storing Attachments with Remote Parameters

import { RemoteAttachmentParameters, StoreAttachmentParameters } from "ravendb";

const session = store.openSession();

// The upload to remote storage (e.g. S3) will be executed at the scheduled time.
const uploadAt = new Date(Date.now() + 3600000); // +1 hour
const remoteParams = new RemoteAttachmentParameters("MyS3Storage", uploadAt);

// Option 1: Using parameters object
const params = new StoreAttachmentParameters(
    "invoice.pdf",
    attachmentStream,
    "application/pdf",
    null,
    remoteParams
);
session.advanced.attachments.store(documentId, params);

// Option 2: Traditional approach (immediate upload)
session.advanced.attachments.store(
    documentId,
    "invoice.pdf",
    attachmentStream,
    "application/pdf"
);

await session.saveChanges();

Bulk Insert with Remote Attachments

const bulkInsert = store.bulkInsert();

const remoteParams = new RemoteAttachmentParameters("MyS3Storage");

for (let i = 0; i < 100; i++) {
    const order = { id: `orders/${i}`, company: `Company ${i}` };
    await bulkInsert.store(order, `orders/${i}`);

    const attachmentData = Buffer.from(`Invoice data ${i}`);
    await bulkInsert.attachmentsFor(`orders/${i}`)
        .store(`invoice-${i}.pdf`, attachmentData, "application/pdf", remoteParams);
}

await bulkInsert.finish();

Configuring Schema Validation

import {
    ConfigureSchemaValidationOperation,
    GetSchemaValidationConfiguration,
    SchemaValidationConfiguration
} from "ravendb";

const userSchema = JSON.stringify({
    type: "object",
    properties: {
        age: {
            type: "integer",
            minimum: 21,
            maximum: 67
        },
        email: {
            type: "string",
            pattern: "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$"
        }
    },
    required: ["age", "email"]
});

const configuration: SchemaValidationConfiguration = {
    validatorsPerCollection: {
        "Users": {
            schema: userSchema
        },
        "Employees": {
            disabled: true,
            schema: userSchema
        }
    }
};

await store.maintenance.send(new ConfigureSchemaValidationOperation(configuration));

// Retrieve configuration later
const config = await store.maintenance.send(new GetSchemaValidationConfiguration());
config.validatorsPerCollection["Users"].disabled = true;
await store.maintenance.send(new ConfigureSchemaValidationOperation(config));

Disabling Schema Validation

// Get current configuration
const config = await store.maintenance.send(new GetSchemaValidationConfiguration());

// Disable validation for a specific collection
config.validatorsPerCollection["Users"].disabled = true;

// Apply changes
await store.maintenance.send(new ConfigureSchemaValidationOperation(config));

🔗 Related Documentation

🛠️ Migration Guide

From Previous Versions (No Breaking Changes Required)

If you're upgrading from v7.1.x:

  1. Optional: Use new parameter objects for cleaner code:

    // Old way (still works)
    session.advanced.attachments.store(id, name, stream, contentType);
    
    // New way (optional)
    session.advanced.attachments.store(id, new StoreAttachmentParameters(name, stream, contentType));
  2. Optional: Configure remote attachments if you want to use cloud storage:

     import { 
         ConfigureRemoteAttachmentsOperation,
         RemoteAttachmentsConfiguration,
         RemoteAttachmentsDestinationConfiguration,
         RemoteAttachmentsS3Settings
     } from "ravendb";
     
     const configuration = new RemoteAttachmentsConfiguration();
     
     const s3Destination = new RemoteAttachmentsDestinationConfiguration();
     s3Destination.disabled = false;
     
     const s3Settings = new RemoteAttachmentsS3Settings();
     s3Settings.bucketName = "my-attachments-bucket";
     s3Settings.awsAccessKey = "YOUR_ACCESS_KEY";
     s3Settings.awsSecretKey = "YOUR_SECRET_KEY";
     s3Settings.awsRegionName = "us-east-1";
     
     s3Destination.s3Settings = s3Settings;
     configuration.destinations["MyS3Storage"] = s3Destination;
     
     await store.maintenance.send(new ConfigureRemoteAttachmentsOperation(configuration));
  3. Optional: Add schema validation to enforce data quality:

    import {
        ConfigureSchemaValidationOperation,
        GetSchemaValidationConfiguration,
        SchemaValidationConfiguration
    } from "ravendb";
    
    const userSchema = JSON.stringify({
        type: "object",
        properties: {
            age: {
                type...
Read more

7.1.6

04 Feb 10:57
feb8ce8

Choose a tag to compare

Bug Fixes

  • Added optional disabled?: boolean field to allow disabling AI agents
  • Implemented getRaftUniqueRequestId() method to DeleteAiAgentOperation for proper cluster coordination

Files Changed

  • src/Documents/Operations/AI/Agents/DeleteAiAgentOperation.ts
  • src/Documents/Operations/AI/Agents/config/AiAgentConfiguration.ts

7.1.5

28 Jan 17:07
cabf7f7

Choose a tag to compare

🎉 What's New

🤖 AI/GenAI Features

AI Agent Enhancements

  • Multi-Part Prompts: Added support for rich content prompts with ContentPart and TextPart classes

    • Use conversation.addUserPrompt() to build multi-part prompts
    • Enhanced RunConversationOperation to accept ContentPart[] arrays
    • Backward compatible with simple string prompts
  • Artificial Action Responses: Introduced AiAgentArtificialActionResponse interface for supplying artificial tool results to AI models

  • Enhanced AI Usage Tracking: Improved AiUsage class with:

    • Support for reasoning tokens (o1/o3 models)
    • Per-turn usage calculation with getUsageDifference() method
    • Better tracking of cached tokens
  • Parameter Visibility Control: Added sendToModel property to AiAgentParameter

    • Hide sensitive parameters (userId, tenantId, etc.) from LLM
    • Enhanced privacy and security for agent interactions
  • Conversation Result Improvements: Added per-turn metrics to ConversationResult:

    • usage: Token usage for specific turn (non-cumulative)
    • elapsed: Time elapsed for turn in milliseconds

GenAI ETL

  • New GenAI ETL Configuration: Introduced GenAiConfiguration class for GenAI tasks

    • Define AI-powered document transformations
    • Configure AI connector settings and prompts
    • Support for custom transformation scripts via GenAiTransformation
    • Query integration for model context
  • ETL Operations:

    • AddGenAiOperation: Create new GenAI ETL tasks
    • UpdateGenAiOperation: Modify existing GenAI ETL tasks with reset capability

Embeddings Generation

  • Embeddings Generation ETL: Complete embeddings generation configuration system

    • EmbeddingsGenerationConfiguration: Monitor collections and generate vector embeddings
    • Path-based approach: Use embeddingsPathConfigurations for specific field paths
    • Script-based approach: Use embeddingsTransformation for custom logic
    • Vector quantization support (Single, Int8, Binary)
  • Chunking Options: Advanced text chunking for embedding generation

    • Multiple chunking methods: PlainText, Markdown, HTML
    • Configurable token limits and overlap
    • Line and paragraph splitting strategies
    • Validation utilities included
  • Embeddings Operations:

    • AddEmbeddingsGenerationOperation: Create embeddings generation tasks
    • UpdateEmbeddingsGenerationOperation: Update existing tasks
    • Cache expiration configuration for both document and query embeddings

AI Connection Strings

  • Embedded Settings: Added EmbeddedSettings for AI connection strings
    • Support for local AI model configurations

Vector Search Enhancements

  • Index Vector Operations: Extended interface with:
    • createVector(): Support for number arrays, streams, and strings
    • loadVector(): Load vectors with embeddings generation task identifiers

🦕 Bun Runtime Support

  • Bun Compatibility: Added comprehensive support for Bun runtime
    • Warning for PFX certificates (not fully supported in Bun)
    • Runtime-aware HTTP decompression (disabled by default for Bun)

📚 API Additions

New Operations

  • AddGenAiOperation
  • UpdateGenAiOperation
  • AddEmbeddingsGenerationOperation
  • UpdateEmbeddingsGenerationOperation

New Interfaces

  • AiAgentArtificialActionResponse - Artificial action responses
  • BunTlsOptions - Bun-specific TLS options
  • AddAiTaskOperationResult - AI task operation results
  • AddEmbeddingsGenerationOperationResult - Embeddings task results

🔄 Breaking Changes

None - This release maintains backward compatibility while adding new features.

📖 Migration Guide

Using Multi-Part Prompts

// Old way (still supported)
conversation.setUserPrompt("What is the weather?");

// New way with multi-part prompts
conversation.addUserPrompt("First part of question.");
conversation.addUserPrompt("Second part with context.");
await conversation.run();

Hiding Sensitive Parameters

const parameter: AiAgentParameter = {
    name: "userId",
    description: "Current user ID",
    sendToModel: false  // Hide from LLM
};

Using Embeddings Generation

const config = new EmbeddingsGenerationConfiguration();
config.name = "Product Embeddings";
config.identifier = "product-embeddings";
config.collection = "Products";
config.embeddingsPathConfigurations = [
    {
        path: "Description",
        chunkingOptions: {
            chunkingMethod: "PlainTextSplitParagraphs",
            maxTokensPerChunk: 512,
            overlapTokens: 50
        }
    }
];

const operation = new AddEmbeddingsGenerationOperation(config);
const result = await store.maintenance.send(operation);

7.1.4

10 Dec 16:33
9c2d803

Choose a tag to compare

What's Changed

  • RDBC-969 Query with whereIn using the exact parameter doesn't work by @M4xymm in #505
  • fix: prevent binary attachment corruption (LF to CRLF conversion) by @BHVampire in #504

New Contributors

Full Changelog: 7.1.3...7.1.4

7.1.3 - AI Enhancements

29 Oct 08:57
c8b9ee8

Choose a tag to compare

🚀 AI Enhancements

The Node.js client now supports AI Server-side streaming and AI Connection Strings.

  • Added AI Server-side streaming and support for AI connection strings (#496)

  • Added AI Agents examples (#491)

  • Added AI Connection Strings support

    • Now supports the following AI providers:

      • AzureOpenAiSettings
      • GoogleSettings
      • HuggingFaceSettings
      • MistralAiSettings
      • OllamaSettings
      • OpenAiSettings
      • VertexSettings
    • Usage example

  • Added onUnhandledAction (#496)

🧠 Vector Search Improvements

  • Added new Vector Search APIs (#495)

    • Introduced the embeddingsGenerationTaskIdentifier parameter in vector search methods (byText, byTexts).
    • Usage example

🐛 Bug Fixes

  • Fixed compare-exchange value deserialization (#493)

    • Compare-exchange values with simple string contents were incorrectly deserialized as character-indexed objects (e.g., { "0": "u", "1": "s", ... }).

    • These methods now correctly return strings such as "users/1".

    • Affected APIs:

      • session.advanced.clusterTransaction.getCompareExchangeValues()
      • session.advanced.clusterTransaction.lazily.getCompareExchangeValues()

Full Changelog: 7.1.0...7.1.3

7.1.0

26 Aug 13:20
a6ff058

Choose a tag to compare

What's Changed

  • RDBC-927 Add null check in revivePeriodicBackupStatus function to prevent flaky test by @M4xymm in #489
  • RDBC-926 AI Agents - Node.js by @M4xymm in #490

Breaking changes:

AI Agents

  • Introduced AI Agents support – new API operations for:

    • Create – register new agents,
    • Update – modify existing agents,
    • Delete – remove agents.
  • Added AI Conversations – ability to start and manage conversations with agents, including sending messages and retrieving responses.

Full Changelog: 7.0.1...7.1.0

7.0.1

15 Jul 10:38
adc9ff0

Choose a tag to compare

What's Changed

  • RDBC-912 Add 7.1 to GHA RavenDB version matrix by @M4xymm in #480
  • RDBC-909 - Returning class instances in client causes issues in Next.js — responses should be plain objects by @M4xymm in #481
  • Bump undici from 6.21.1 to 6.21.2 by @dependabot[bot] in #478
  • RDBC-908 Node.js Client malfunction in SSR applications by @M4xymm in #482
  • RDBC-918 - Allow to query vector searching using a document id by @M4xymm in #484
  • Fixed build status badge in README by @M4xymm in #485

Breaking changes:

Vector Search API

  • New Feature:
    • Allow to query vector searching using a document id.
  • Usage Examples:
session.query<Dto>({collection: "Dtos"})
            .vectorSearch(field => field.withEmbedding("EmbeddingSingles"),
                factory => factory.forDocument("dtos/full-options"), {
                    similarity: 0.75,
                    numberOfCandidates: 100
                })

Return Plain Objects

  • New Feature:
    • Gets whether all values returned will be plain objects (not class instances as previous). This is useful for environments like Next.js.
  • Usage examples
const store: DocumentStore = new DocumentStore("http://127.0.0.1:8080/", "test-db");


store.conventions.returnPlainJsObjects = true;

store.initialize();

Full Changelog: 7.0.0...7.0.1

7.0.0

29 Apr 07:36
27daa57

Choose a tag to compare

What's Changed

  • RDBC-870 Add explanation of session & store dispose to the readme by @Danielle9897 in #459
  • RDBC-872 swc should be dev not prod dependency by @ml054 in #462
  • RDBC-875 Expose MetadataDictionary in index.ts by @ml054 in #463
  • RDBC-873 Fix handling server failure in 6.0.0 client by @ml054 in #464
  • RDBC-880 Expose CreateSubscriptionCommand in index.ts by @Danielle9897 in #465
  • RDBC-885 Add 7.0 to GHA RavenDB version matrix by @ml054 in #470
  • Adding v7.0 to build matrix by @ml054 in #474
  • RDBC-899 - Added Vector Search to Client API, updated client version to 7.0 by @M4xymm in #475
  • RDBC-903 - Drop Node.js 18 support by @M4xymm in #476

Breaking changes:

Vector Search API

  • New Feature:
    Added Vector Search support to align with RavenDB 7.0’s capabilities.
  • Usage Examples:
    Check out VectorSearchTest.ts for sample queries and indexing patterns.

6.0.0

27 Aug 09:13
9e4f9a8

Choose a tag to compare

Change log:

Breaking changes:

  • unified custom casing conventions: currently user needs to provide transformation functions: localToServerFieldNameConverter, serverToLocalFieldNameConverter when casing in documents should be changed before storing/reading documents. By default original - casing is retained and user don't have to provide any extra configuration.
  • removed support for Graph API
  • Include from a Non-tracking session: A non-tracking session will now throw the below exception if an 'Include' operation is registered in it, to indicate that the operation is forbidden from a non-tracking session and warn about its expected results.
  • Facets: FacetOptions were removed from RangeFacet
    removed option to enable/disable JSONL parsing (DocumentConventions.useJsonlStreaming) - we now always use JSON

5.4.3

17 Jul 14:07
98ddab1

Choose a tag to compare

What's Changed

  • next release 5.4.3 by @ml054 in #407
  • etl connection strings by @ml054 in #408
  • RDBC-806 Add "@refresh" to CONSTANTS by @Danielle9897 in #413
  • RDBC-825 Add loadAttachments + test by @Danielle9897 in #415
  • fix: Error thrown when running DocumentStore.initialize() with an insecure connection when passing AuthOptions, even if no certificate was passed. by @vxern in #412
  • RDoc-2699 Fix comment in README about bulkInsert by @Danielle9897 in #416
  • sync with java: be9b7f88aa409ee0915d80a0cf7e87f30ba4f219..682bb13d764… by @ml054 in #411
  • Cannot query with where after moreLikeThis #409 by @ml054 in #417
  • RDBC-432 get rid of bluebird from node.js client by @ml054 in #418
  • eslint - extra rules 🦄 by @ml054 in #421
  • RDBC-831 Add test for "GetCompareExchangeValuesOperation" by @Danielle9897 in #422
  • RDBC-832 Fix DeleteCompareExchangeValueOperation behavior when key doesn't exist by @Danielle9897 in #423
  • RDBC-850 Expose all classes from TimeSeriesOperation.ts by @Danielle9897 in #427
  • npm update by @ml054 in #432
  • RavenDB-16050 Exporting query result to JSON - updating node.js client by @ml054 in #433
  • RDBC-860 Expose TimeValue in index.ts (v5.4) by @Danielle9897 in #435
  • RDBC-859 OOM on bulk insert - node.js client by @ml054 in #437
  • npm update by @ml054 in #438

New Contributors

Full Changelog: 5.4.2...5.4.3