Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified .github/scripts/download_packages.sh
100755 → 100644
Empty file.
4 changes: 2 additions & 2 deletions .github/workflows/continuous-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ jobs:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
.github/scripts/download_packages.sh
SUITE=latest DOCUMENTDB_VERSION="$DOCUMENTDB_LATEST_VERSION" .github/scripts/download_packages.sh
bash .github/scripts/download_packages.sh
SUITE=latest DOCUMENTDB_VERSION="$DOCUMENTDB_LATEST_VERSION" bash .github/scripts/download_packages.sh
- name: Verify generated package components
if: steps.features.outputs.packages == 'true'
env:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ jobs:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
.github/scripts/download_packages.sh
bash .github/scripts/download_packages.sh
# Unpinned, like the deploy while DOCUMENTDB_LATEST_VERSION is unset.
SUITE=latest DOCUMENTDB_VERSION=latest .github/scripts/download_packages.sh
SUITE=latest DOCUMENTDB_VERSION=latest bash .github/scripts/download_packages.sh
- name: Verify release inventory and metadata
run: python3 .github/scripts/verify_package_inventory.py
- name: Resolve both PostgreSQL majors and retired endpoints
Expand Down
9 changes: 9 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!-- BEGIN:nextjs-agent-rules -->

## This is NOT the Next.js you know

This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` (resolved from this file's directory; in monorepos the `next` package may not be visible from the repo root) before writing any code. Heed deprecation notices.

This block is written and re-added by `next dev` — verify at `node_modules/next/dist/server/lib/generate-agent-files.js`. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean.

<!-- END:nextjs-agent-rules -->
7 changes: 6 additions & 1 deletion app/ai/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ const useCases = [
description:
"Store chunks, metadata, and embeddings together so retrieval stays close to the source document.",
points: [
"Pre-filter by category, source, or recency before retrieval",
"Combine vector retrieval with indexed metadata filters; result counts are best-effort",
"Return source text alongside similarity scores",
],
sampleId: "hotel-agent-ts",
Expand Down Expand Up @@ -438,6 +438,11 @@ export default function AIPage() {
title="Built for the AI workloads that matter"
description="Vector retrieval, document storage, and query power in one system — ready for the patterns teams are actually shipping."
/>
<p className="mb-6 max-w-3xl text-sm leading-6 text-gray-300">
Vector filters intersect approximate nearest-neighbor results: filter paths must be indexed,
counts are best-effort, and filtered search is unsupported on sharded collections.{" "}
<Link href={vectorSearchReference} className={textLinkClass}>Read the vector search limitations</Link>
</p>
<div className="grid gap-4 md:grid-cols-2">
{useCases.map((item) => {
const link = useCaseLink(item);
Expand Down
60 changes: 60 additions & 0 deletions app/components/StaticInstallGuides.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import Link from "next/link";
import CommandSnippet from "./CommandSnippet";
import TelemetryNote from "./TelemetryNote";
import { buildAptInstallCommand, buildRpmInstallCommand, buildSetupCommand } from "../lib/packageInstall";

const linkClass = "text-blue-300 underline underline-offset-4";

export default function StaticInstallGuides() {
return (
<section aria-label="Static installation quickstarts" className="space-y-6 rounded-xl border border-neutral-700 bg-neutral-800/60 p-4 sm:p-6">
<h2 className="text-2xl font-bold text-white">Install without the selector</h2>
<p className="text-sm leading-6 text-gray-300">
These are standalone quickstarts, not commands customized from this URL.
Choose the guide matching your environment. The interactive selector loads separately.
</p>
<div className="space-y-3">
<h3 className="text-xl font-semibold text-white">Docker: local evaluation and development</h3>
<p className="text-sm text-gray-300">Requires Docker and an available port 10260. Replace both credential placeholders before running.</p>
<CommandSnippet label="Start local Docker container" command={`docker run -dt --pull always --name documentdb \\
-p 127.0.0.1:10260:10260 \\
-e USERNAME='<YOUR_USERNAME>' \\
-e PASSWORD='<YOUR_PASSWORD>' \\
ghcr.io/documentdb/documentdb/documentdb-local:latest`} />
<TelemetryNote />
<p className="text-sm text-gray-300">
Wait for <code>=== DocumentDB is ready ===</code> in <code>docker logs documentdb</code>, then follow the{" "}
<Link href="/docs/getting-started/docker" className={linkClass}>Docker quickstart</Link> to connect and verify.
</p>
</div>
<div className="space-y-3">
<h3 className="text-xl font-semibold text-white">Linux packages: a new PostgreSQL 18 instance</h3>
<p className="text-sm text-gray-300">
Requires a supported Linux host, sudo and internet access. These commands use the moving <code>latest</code> channel and detect host architecture.
For an existing installation, <Link href="/docs/linux-packages#upgrading" className={linkClass}>upgrade in place</Link> instead.
</p>
<details>
<summary className="cursor-pointer text-blue-300">Ubuntu 24.04 (AMD64 or ARM64)</summary>
<CommandSnippet label="Ubuntu 24.04 install" command={buildAptInstallCommand("ubuntu24", "auto", "18")} />
</details>
<details>
<summary className="cursor-pointer text-blue-300">Registered RHEL 9 (AMD64 or ARM64)</summary>
<CommandSnippet label="RHEL 9 install" command={buildRpmInstallCommand("rhel9", "auto", "18")} />
</details>
<details>
<summary className="cursor-pointer text-blue-300">Rocky Linux 9 (AMD64 or ARM64)</summary>
<CommandSnippet label="Rocky Linux 9 install" command={buildRpmInstallCommand("rocky9", "auto", "18")} />
</details>
<p className="text-sm text-gray-300">
Firewall port 10260 before setup: the gateway listens on all interfaces.
Setup asks for an admin password and starts a private PostgreSQL instance.
</p>
<CommandSnippet label="Set up PostgreSQL 18" command={buildSetupCommand("18")} />
<p className="text-sm text-gray-300">
Check <code>sudo documentdb-setup --status</code>, then follow the{" "}
<Link href="/docs/getting-started/packages" className={linkClass}>Linux packages quickstart</Link> for connection, first-query verification, troubleshooting and cleanup.
</p>
</div>
</section>
);
}
87 changes: 87 additions & 0 deletions app/components/StructuredData.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
import { siteUrl } from "../services/metadataService";

export const softwareId = `${siteUrl}/#software`;

export const projectStructuredData = {
"@context": "https://schema.org",
"@graph": [
{
"@type": "Organization",
"@id": `${siteUrl}/#project`,
name: "DocumentDB",
url: `${siteUrl}/`,
parentOrganization: {
"@type": "Organization",
name: "The Linux Foundation",
url: "https://www.linuxfoundation.org/",
},
},
{
"@type": "SoftwareSourceCode",
"@id": softwareId,
name: "DocumentDB",
description: "An MIT-licensed, open-source, MongoDB-compatible document database built on PostgreSQL.",
url: `${siteUrl}/`,
codeRepository: "https://github.com/documentdb/documentdb",
license: "https://opensource.org/license/mit",
programmingLanguage: ["C", "Rust"],
publisher: { "@id": `${siteUrl}/#project` },
},
{
"@type": "WebSite",
"@id": `${siteUrl}/#website`,
name: "DocumentDB",
url: `${siteUrl}/`,
about: { "@id": softwareId },
publisher: { "@id": `${siteUrl}/#project` },
},
],
};

export function articleStructuredData({
title, description, path, breadcrumbs, dateModified,
}: {
title: string;
description?: string;
path: string;
breadcrumbs: { name: string; path: string }[];
dateModified?: string;
}) {
const url = new URL(path, siteUrl).href;
return {
"@context": "https://schema.org",
"@graph": [
{
"@type": "TechArticle",
"@id": `${url}#article`,
headline: title,
description,
url,
mainEntityOfPage: url,
inLanguage: "en",
about: { "@id": softwareId },
isPartOf: { "@id": `${siteUrl}/#website` },
publisher: { "@id": `${siteUrl}/#project` },
...(dateModified ? { dateModified } : {}),
},
{
"@type": "BreadcrumbList",
itemListElement: breadcrumbs.map((item, index) => ({
"@type": "ListItem",
position: index + 1,
name: item.name,
item: new URL(item.path, siteUrl).href,
})),
},
],
};
}

export default function StructuredData({ data }: { data: object }) {
return (
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(data).replace(/</g, "\\u003c") }}
/>
);
}
25 changes: 24 additions & 1 deletion app/docs/[section]/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import Link from "next/link";
import { notFound } from 'next/navigation';
import { capitalCase } from 'change-case';
import { getAllArticlePaths, getArticleByPath } from "../../../services/articleService";
import { getMetadata } from "../../../services/metadataService";
import { getMetadata, getModifiedTime } from "../../../services/metadataService";
import StructuredData, { articleStructuredData } from "../../../components/StructuredData";
import ComingSoon from "../../../components/ComingSoon";
import CommandSnippet from "../../../components/CommandSnippet";
import TelemetryNote from "../../../components/TelemetryNote";
Expand Down Expand Up @@ -96,6 +97,8 @@ export async function generateMetadata({ params }: PageProps) {
description: frontmatter.description || '',
path: slug.length > 0 ? `/docs/${section}/${slug.join('/')}/` : `/docs/${section}/`,
type: 'article',
modifiedTime: getModifiedTime(frontmatter.last_modified_at),
noindex: frontmatter.layout === 'coming-soon',
});
}

Expand All @@ -114,6 +117,7 @@ export default async function ArticlePage({ params }: PageProps) {
}

const { content, frontmatter, navigation, file } = articleData;
const modifiedTime = getModifiedTime(frontmatter.last_modified_at);
const selectedNavItem = navigation.find((item) =>
item.link.includes(file)
);
Expand All @@ -130,6 +134,7 @@ export default async function ArticlePage({ params }: PageProps) {
const sectionTitle = capitalCase(section)
.replace(/documentdb/i, 'DocumentDB')
.replace(/api/i, 'API');
const pagePath = slug.length > 0 ? `/docs/${section}/${slug.join('/')}/` : `/docs/${section}/`;

// Rendered once, shown in the desktop sidebar and the mobile disclosure
const navigationLinks = navigation.map((item) => {
Expand Down Expand Up @@ -160,6 +165,18 @@ export default async function ArticlePage({ params }: PageProps) {

return (
<div className="min-h-screen bg-neutral-900 relative overflow-hidden">
{!isComingSoon && <StructuredData data={articleStructuredData({
title: pageTitle,
description: frontmatter.description,
path: pagePath,
dateModified: modifiedTime,
breadcrumbs: [
{ name: 'Home', path: '/' },
{ name: 'Documentation', path: '/docs/' },
...(slug.length > 0 ? [{ name: sectionTitle, path: `/docs/${section}/` }] : []),
{ name: pageTitle, path: pagePath },
],
})} />}
{/* Background elements */}
<div className="absolute inset-0 bg-gradient-to-br from-neutral-900 via-neutral-800 to-black"></div>
<div className="absolute inset-0 opacity-5">
Expand Down Expand Up @@ -236,6 +253,12 @@ export default async function ArticlePage({ params }: PageProps) {
</h1>
)}
{isComingSoon && <ComingSoon />}
{modifiedTime && (
<p className="mb-4 text-sm text-gray-300">
Last updated: <time dateTime={modifiedTime}>{modifiedTime.slice(0, 10)}</time>.
{frontmatter.applies_to ? ` ${frontmatter.applies_to}` : ''}
</p>
)}

{showInstallPrimer && (
<section className="mb-8 rounded-2xl border border-blue-500/30 bg-gradient-to-br from-blue-500/10 via-neutral-900/90 to-neutral-900/90 p-6">
Expand Down
4 changes: 4 additions & 0 deletions app/docs/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ export default function Docs() {
<p className="text-xl text-gray-400 max-w-3xl mx-auto mb-8">
{articleContent.landing.description}
</p>
<p className="text-sm text-gray-300 mb-6">
Documentation for the open-source project, not similarly named managed services.{" "}
<Link href="/blogs/posts/documentdb-name-disambiguation/" className="text-blue-300 underline underline-offset-4">DocumentDB naming guide</Link>
</p>
<div className="w-32 h-1 bg-gradient-to-r from-blue-500 via-purple-500 to-green-500 mx-auto rounded-full"></div>
</div>

Expand Down
18 changes: 17 additions & 1 deletion app/docs/reference/[type]/[category]/[name]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { notFound } from 'next/navigation';
import Breadcrumb from '../../../../../components/Breadcrumb';
import Markdown from '../../../../../components/Markdown';
import { getAllReferenceParams, getReferenceByPath } from '../../../../../services/referenceService';
import { getMetadata } from "../../../../../services/metadataService";
import { getMetadata, getModifiedTime } from "../../../../../services/metadataService";
import StructuredData, { articleStructuredData } from "../../../../../components/StructuredData";

export async function generateMetadata({ params }: { params: Promise<{ type: string; category: string; name: string }> }) {
const { type, category, name } = await params;
Expand All @@ -22,6 +23,7 @@ export async function generateMetadata({ params }: { params: Promise<{ type: str
description: data.frontmatter.description || '',
path: `/docs/reference/${type}/${category}/${name}/`,
type: 'article',
modifiedTime: getModifiedTime(data.frontmatter.last_modified_at),
extraKeywords: ['reference', type, category, name]
});
}
Expand All @@ -44,6 +46,20 @@ export default async function ReferencePage({ params }: { params: Promise<{ type

return (
<article>
<StructuredData data={articleStructuredData({
title: pageTitle,
description: pageDescription,
path: `/docs/reference/${type}/${category}/${name}/`,
dateModified: getModifiedTime(data.frontmatter.last_modified_at),
breadcrumbs: [
{ name: 'Home', path: '/' },
{ name: 'Documentation', path: '/docs/' },
{ name: 'MQL Reference', path: '/docs/reference/' },
{ name: type, path: `/docs/reference/${type}/` },
{ name: category, path: `/docs/reference/${type}/${category}/` },
{ name: pageTitle, path: `/docs/reference/${type}/${category}/${name}/` },
],
})} />
<Breadcrumb type={type} category={category} name={pageTitle} />

{/* Markdown Content */}
Expand Down
2 changes: 2 additions & 0 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import "./globals.css";
import AnnouncementBar from "./components/AnnouncementBar";
import Navbar from "./components/Navbar";
import { getMetadata } from "./services/metadataService";
import StructuredData, { projectStructuredData } from "./components/StructuredData";

const inter = Inter({ subsets: ["latin"] });

Expand All @@ -20,6 +21,7 @@ export default function RootLayout({
return (
<html lang="en">
<body className={inter.className}>
<StructuredData data={projectStructuredData} />
<AnnouncementBar />
<Navbar />
{children}
Expand Down
13 changes: 10 additions & 3 deletions app/packages/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useSearchParams } from "next/navigation";
import { Suspense, useEffect, useState } from "react";
import CommandSnippet from "../components/CommandSnippet";
import TelemetryNote from "../components/TelemetryNote";
import StaticInstallGuides from "../components/StaticInstallGuides";
import {
aptTargetLabels,
aptTargetPgVersions,
Expand Down Expand Up @@ -134,6 +135,12 @@ export default function PackagesPage() {
<header className="text-center">
<h1 className="text-4xl font-extrabold text-white sm:text-5xl">Install DocumentDB</h1>
<p className="mt-4 text-lg text-gray-300">Start a local database and run your first query in a few minutes.</p>
<p className="mt-3 text-sm text-gray-300">
Complete static guides:{" "}
<Link href="/docs/getting-started/docker" className={linkClass}>Docker quickstart</Link>
{" · "}
<Link href="/docs/getting-started/packages" className={linkClass}>Linux packages quickstart</Link>.
</p>
</header>

<section aria-label="Installation method" className="grid gap-3 sm:grid-cols-2">
Expand All @@ -158,7 +165,7 @@ export default function PackagesPage() {

<noscript>
<p className="text-gray-200">
Enable JavaScript to select installation commands, or follow the{" "}
Use the standalone instructions below without JavaScript, or follow the{" "}
<Link href="/docs/getting-started/packages" className={linkClass}>Linux quickstart</Link>{" "}
or <Link href="/docs/getting-started/docker" className={linkClass}>Docker quickstart</Link>.
</p>
Expand All @@ -177,9 +184,9 @@ export default function PackagesPage() {
</div>
)}

{/* The static page can't see the query string, so show no flow until it is read. */}
{/* Standalone guides must not imply that an unvalidated query selected a target. */}
{state === null ? (
<p className="text-center text-sm text-gray-400">Loading installation steps...</p>
<StaticInstallGuides />
) : method === "packages" ? (
<section className={panelClass} aria-label="Linux packages installation">
<label htmlFor="install-target" className="block text-sm font-medium text-gray-200">Linux distribution</label>
Expand Down
Loading