Releases: ravendb/ravendb-nodejs-client
7.2.0
🎉 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 destinationsGetRemoteAttachmentsConfigurationOperation: Retrieve current configuration- Full support in bulk insert and regular session operations
Cloud Storage Settings Classes
RemoteAttachmentsConfiguration: Main configuration containerRemoteAttachmentsDestinationConfiguration: Individual destination settingsRemoteAttachmentsS3Settings: Amazon S3 configurationRemoteAttachmentsAzureSettings: Azure Blob Storage configurationRemoteAttachmentParameters: 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 configurationGetSchemaValidationConfiguration: 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 parametersRemoteAttachmentFlags: Type-safe flags for remote attachment behaviorRemoteAttachmentParameters: Configure remote uploads with optional scheduling
Updated Attachment Interface
- Attachment metadata now includes optional
remoteParameters - Enhanced
AttachmentDetailswith 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
- RavenDB Remote Attachments Documentation
- RavenDB Schema Validation Documentation
- JSON Schema Specification
🛠️ Migration Guide
From Previous Versions (No Breaking Changes Required)
If you're upgrading from v7.1.x:
-
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));
-
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));
-
Optional: Add schema validation to enforce data quality:
import { ConfigureSchemaValidationOperation, GetSchemaValidationConfiguration, SchemaValidationConfiguration } from "ravendb"; const userSchema = JSON.stringify({ type: "object", properties: { age: { type...
7.1.6
Bug Fixes
- Added optional
disabled?: booleanfield to allow disabling AI agents - Implemented
getRaftUniqueRequestId()method toDeleteAiAgentOperationfor proper cluster coordination
Files Changed
src/Documents/Operations/AI/Agents/DeleteAiAgentOperation.tssrc/Documents/Operations/AI/Agents/config/AiAgentConfiguration.ts
7.1.5
🎉 What's New
🤖 AI/GenAI Features
AI Agent Enhancements
-
Multi-Part Prompts: Added support for rich content prompts with
ContentPartandTextPartclasses- Use
conversation.addUserPrompt()to build multi-part prompts - Enhanced
RunConversationOperationto acceptContentPart[]arrays - Backward compatible with simple string prompts
- Use
-
Artificial Action Responses: Introduced
AiAgentArtificialActionResponseinterface for supplying artificial tool results to AI models -
Enhanced AI Usage Tracking: Improved
AiUsageclass with:- Support for reasoning tokens (o1/o3 models)
- Per-turn usage calculation with
getUsageDifference()method - Better tracking of cached tokens
-
Parameter Visibility Control: Added
sendToModelproperty toAiAgentParameter- 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
GenAiConfigurationclass 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 tasksUpdateGenAiOperation: 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
embeddingsPathConfigurationsfor specific field paths - Script-based approach: Use
embeddingsTransformationfor 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 tasksUpdateEmbeddingsGenerationOperation: Update existing tasks- Cache expiration configuration for both document and query embeddings
AI Connection Strings
- Embedded Settings: Added
EmbeddedSettingsfor 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 stringsloadVector(): 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
AddGenAiOperationUpdateGenAiOperationAddEmbeddingsGenerationOperationUpdateEmbeddingsGenerationOperation
New Interfaces
AiAgentArtificialActionResponse- Artificial action responsesBunTlsOptions- Bun-specific TLS optionsAddAiTaskOperationResult- AI task operation resultsAddEmbeddingsGenerationOperationResult- 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
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
- @BHVampire made their first contribution in #504
Full Changelog: 7.1.3...7.1.4
7.1.3 - AI Enhancements
🚀 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:
AzureOpenAiSettingsGoogleSettingsHuggingFaceSettingsMistralAiSettingsOllamaSettingsOpenAiSettingsVertexSettings
-
-
Added onUnhandledAction (#496)
🧠 Vector Search Improvements
-
Added new Vector Search APIs (#495)
- Introduced the
embeddingsGenerationTaskIdentifierparameter in vector search methods (byText,byTexts). - Usage example
- Introduced the
🐛 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
What's Changed
- RDBC-927 Add null check in
revivePeriodicBackupStatusfunction 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
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
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
Change log:
- minimum node.js version: 18+
- serialization customization, ability to use class-transformer library, example: https://github.com/ravendb/ravendb-nodejs-client/blob/5404b45c83d7d55a0a8754e5984b6e9685f1ec6f/test/Ported/CustomSerializationTest.ts#L16
- dual build: commonjs and esm
- dependencies clean up
- removed moment.js and using date-fns instead
- database record builder examples
- support for data archival
- support for query sinks
- support for sharded databases
- combability with hosting providers like Vercel, Amplify (and technologies like next.js etc), see: RDBC-863
- bulk insert performance as now twice fast as it was
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
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 passingAuthOptions, 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