From a316e9eef9f9d3dea555704d570e9075659d94d5 Mon Sep 17 00:00:00 2001 From: Guanzhou Song <26541184+GuanzhouSong@users.noreply.github.com> Date: Mon, 16 Nov 2026 13:36:15 -0500 Subject: [PATCH] Fix unrunnable commands and product wording in the two newest posts The collation tutorial's docker run had literal \n instead of line breaks, and it needs v1.3, which is unreleased: on the published 1.2 image step 2 fails on documentdb.enable_collation_with_create_collection. Say so and add a version check. The pgAudit post named a Microsoft Purview sink it never explains. Signed-off-by: Guanzhou Song <26541184+GuanzhouSong@users.noreply.github.com> --- ...026-11-13-collated-collections-and-indexes.md | 16 ++++++++++++++-- ...1-13-documentdb-audit-logging-with-pgaudit.md | 4 ++-- tests/containerCredentials.test.ts | 7 +++++++ 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/blogs/_posts/2026-11-13-collated-collections-and-indexes.md b/blogs/_posts/2026-11-13-collated-collections-and-indexes.md index eae18f4..ed8ab64 100644 --- a/blogs/_posts/2026-11-13-collated-collections-and-indexes.md +++ b/blogs/_posts/2026-11-13-collated-collections-and-indexes.md @@ -17,6 +17,8 @@ Should a query for `"a"` also match `"A"`? By using collation, you can make that DocumentDB OSS beginning **v1.3 supports creating unsharded collections with collation**. Collation uses Unicode (ICU) rules for locale-aware string comparisons, including case- and accent-insensitive matching. Supported collated indexes can serve queries whose collation matches the index. +> **v1.3 isn't released yet.** The newest published image is v1.2, which lacks the `documentdb.enable_collation_with_create_collection` flag, so step 2 fails on it. Until v1.3 ships, you need an image built from the [`main` branch](https://github.com/documentdb/documentdb); the [changelog](https://github.com/documentdb/documentdb/blob/main/CHANGELOG.md) shows when it's released. + This walkthrough enables the required feature flags, creates a collection and a non-unique index, and demonstrates a case-insensitive query. It is based on [the original example and feature-flag notes](https://gist.github.com/xgerman/0d84036a676927a9382785cbffc857af). ## Choose how strings compare @@ -30,14 +32,24 @@ Use `{ locale: "en", strength: 2 }`, so `"a"` and `"A"` compare equal, as do `"b ## 1. Start a local container -You need Docker and a **DocumentDB OSS v1.3 image**. The following command uses `latest`, a moving tag; ensure the image includes v1.3 before proceeding. +You need Docker and a **DocumentDB OSS v1.3 image**. The following command uses `latest`, a moving tag that points to v1.2 until v1.3 is released. ```bash -docker run -d --name docdb-test -p 127.0.0.1:10260:10260 \n -e USERNAME=testuser \n -e PASSWORD=testpass123 \n ghcr.io/documentdb/documentdb/documentdb-local:latest +docker run -d --name docdb-test -p 127.0.0.1:10260:10260 \ + -e USERNAME=testuser \ + -e PASSWORD=testpass123 \ + ghcr.io/documentdb/documentdb/documentdb-local:latest ``` Allow the gateway to finish starting before connecting. The published port is bound to localhost, and the credentials are for this disposable local example only. +Check the version before you continue; it must be `1.3-0` or later: + +```bash +docker exec docdb-test psql -X -U documentdb -p 9712 -d postgres \ + -Atc "SELECT extversion FROM pg_extension WHERE extname = 'documentdb';" +``` + ## 2. Enable the collation feature flags To create a collated collection, you need to enable **all five feature flags** listed below, even if the application index you create is non-unique. diff --git a/blogs/_posts/2026-11-13-documentdb-audit-logging-with-pgaudit.md b/blogs/_posts/2026-11-13-documentdb-audit-logging-with-pgaudit.md index 5ca9c33..c6d2674 100644 --- a/blogs/_posts/2026-11-13-documentdb-audit-logging-with-pgaudit.md +++ b/blogs/_posts/2026-11-13-documentdb-audit-logging-with-pgaudit.md @@ -252,9 +252,9 @@ For conventional actor-based auditing of writes and collection DDL: 4. Leave global auditing disabled and enable `write, ddl` on each audited role. 5. Keep SQL statement and parameter logging disabled; enable relation and row-count logging. 6. Reconnect clients and verify the resulting records with a representative workload. -7. Send logs to a durable, access-controlled Microsoft Purview Audit sink. +7. Send logs to a durable, access-controlled audit-log destination. 8. Retain catalog mapping history if consumers require logical collection names. -For authoritative commit outcomes, document reconstruction, or recovery after ordinary Audit logs are lost, complement this approach with [WAL-based forensic analysis](https://github.com/xgerman/documentdb-wal-audit) and an appropriate WAL-retention strategy. +For authoritative commit outcomes, document reconstruction, or recovery after ordinary audit logs are lost, complement this approach with [WAL-based forensic analysis](https://github.com/xgerman/documentdb-wal-audit) and an appropriate WAL-retention strategy. The useful distinction is simple: **pgAudit records actor-attributed PostgreSQL activity; WAL-based analysis addresses what committed and what can be reconstructed.** Choose the evidence your audit requirements actually need. diff --git a/tests/containerCredentials.test.ts b/tests/containerCredentials.test.ts index 78f55cf..6e40e3b 100644 --- a/tests/containerCredentials.test.ts +++ b/tests/containerCredentials.test.ts @@ -49,4 +49,11 @@ describe('container credentials', () => { } } }); + + // A literal \n in Markdown is two characters, not a line break; the pasted command fails. + it.each(sources().filter((file) => file.endsWith('.md')).map((file) => [path.relative(root, file), file]))('%s has no literal \\n in a run command', (_name, file) => { + for (const command of runCommands(fs.readFileSync(file, 'utf8'))) { + expect(command).not.toMatch(/\\n/); + } + }); });