fle-nodejs
Field-Level Encryption with the Couchbase Node.js SDK — CryptoManager setup, encrypting and decrypting document fields
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Field-Level Encryption with the Couchbase Node.js SDK — CryptoManager setup, encrypting and decrypting document fields
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Couchbase SDK error handling — UnambiguousTimeoutException vs AmbiguousTimeoutException, DocumentNotFoundException, CasMismatchException, DurabilityImpossibleException, SDK debug logging, sdk-doctor connectivity diagnostics, retryable vs non-retryable errors, circuit breaker, error best practices
Couchbase SDK patterns for Rust — CAS optimistic locking, retry on CasMismatch, tokio bulk operations with join_all/FuturesUnordered, atomic counters, sub-document (MutateInSpec/LookupInSpec), array operations, exists, replica reads, touch/getAndTouch, preserve_expiry, error handling
Configure and optimize Couchbase SDK connections in Rust — async/tokio cluster setup, singleton pattern, wait_until_ready, timeouts, KV CRUD (upsert/insert/get/replace/remove), expiry, durability, sub-document operations
SQL++ queries with the Couchbase Rust SDK — scope.query, cluster.query, positional and named parameters, scan consistency, deserializing rows into structs, DML (INSERT/UPDATE/DELETE/UPSERT), MutationState RYOW
Testing Couchbase Rust applications — unit testing with mockall, integration testing with testcontainers-rs, scope/collection isolation
Distributed ACID transactions are not supported by the Couchbase Rust SDK 1.x — alternatives and workarounds
| name | fle-nodejs |
| summary | Field-Level Encryption with the Couchbase Node.js SDK — CryptoManager setup, encrypting and decrypting document fields |
| description | Field-Level Encryption with the Couchbase Node.js SDK — CryptoManager setup, encrypting and decrypting document fields |
| compatibility | Node.js SDK 4.x. couchbase-encryption npm package required. |
| metadata | {"last_verified":"2026-05","min_server_version":"6.0","handoff":[{"condition":"user asks about FLE concepts or supported SDKs","skill":"fle"},{"condition":"user asks about connection setup","skill":"server-connection-nodejs"}]} |
npm install couchbase couchbase-encryption
const couchbase = require('couchbase');
const { AeadAes256CbcHmacSha512Provider, DefaultCryptoManager, Key } =
require('couchbase-encryption');
const keyBytes = Buffer.alloc(64); // 64-byte key for AES-256
const provider = new AeadAes256CbcHmacSha512Provider({
keys: { 'my-key-id': keyBytes }
});
const cryptoManager = new DefaultCryptoManager();
cryptoManager.registerEncrypter('my-encrypter', provider.encrypterForKey('my-key-id'));
cryptoManager.registerDecrypter(provider.decrypter());
const cluster = await couchbase.connect('couchbase://localhost', {
username: 'username',
password: 'Password!123',
cryptoManager,
});
const collection = cluster.bucket('myapp').defaultCollection();
const doc = {
name: 'Alice',
ssn: '123-45-6789',
creditCard: '4111111111111111',
};
await collection.upsert('user::alice', doc, {
encryptFields: {
ssn: 'my-encrypter',
creditCard: 'my-encrypter',
},
});
const result = await collection.get('user::alice');
// Decryption is automatic when cryptoManager is configured
console.log(result.content.ssn); // "123-45-6789"
fle for full concept reference