{"_id":"@apostrophecms/db-connect","_rev":"6-abb6190a04fe01d608420aa3a370db1b","name":"@apostrophecms/db-connect","dist-tags":{"latest":"1.0.2","alpha":"1.0.2-alpha.0"},"versions":{"1.0.0-alpha.1":{"name":"@apostrophecms/db-connect","version":"1.0.0-alpha.1","_id":"@apostrophecms/db-connect@1.0.0-alpha.1","maintainers":[{"name":"alexgilbert","email":"alex@apostrophecms.com"},{"name":"boutell","email":"tom@apostrophecms.com"},{"name":"romanek","email":"stuart+npm@apostrophecms.com"},{"name":"bodonkey","email":"robert.means1969+apostrophecms@gmail.com"}],"bin":{"apos-db-dump":"bin/apos-db-dump.js","apos-db-restore":"bin/apos-db-restore.js"},"dist":{"shasum":"aa66780b6d0addd18108fc60b2e57f1cf85edd4a","tarball":"https://registry.npmjs.org/@apostrophecms/db-connect/-/db-connect-1.0.0-alpha.1.tgz","fileCount":32,"integrity":"sha512-TGQnxSuylHtBObHGzVPvt9BnvWPjNwMt2TzBbRlp6+Vnn7sKUkkQ01oh8ZmeCxGgHJbHvFHHFUke3Oln3MgdSw==","signatures":[{"sig":"MEYCIQDmGh2ZYVYZ9Zl2NirqL9GoNo4mGYcf4zratxTHs2RWDwIhAO6w4wn/N/F1AiBsx2xRej61K4TVIk7qMup334xNZeCD","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":377596},"main":"index.js","_from":"file:apostrophecms-db-connect-1.0.0-alpha.1.tgz","scripts":{"lint":"eslint .","test":"mocha test/**/*.test.js --timeout 30000","eslint":"eslint .","test:sqlite":"ADAPTER=sqlite mocha test/**/*.test.js --timeout 30000","test:mongodb":"ADAPTER=mongodb mocha test/**/*.test.js --timeout 30000","test:postgres":"ADAPTER=postgres mocha test/**/*.test.js --timeout 30000"},"_npmUser":{"name":"boutell","email":"tom@apostrophecms.com"},"_resolved":"/tmp/92c2e84fc3cdc7a868f5cccb729e2558/apostrophecms-db-connect-1.0.0-alpha.1.tgz","_integrity":"sha512-TGQnxSuylHtBObHGzVPvt9BnvWPjNwMt2TzBbRlp6+Vnn7sKUkkQ01oh8ZmeCxGgHJbHvFHHFUke3Oln3MgdSw==","_npmVersion":"10.8.2","description":"Database connection library and dump/restore tools for ApostropheCMS","directories":{},"_nodeVersion":"20.19.5","dependencies":{"pg":"^8.11.3","better-sqlite3":"^11.0.0","@apostrophecms/emulate-mongo-3-driver":"^1.0.6"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.3.10","mocha":"^11.7.1","eslint":"^9.39.1","eslint-config-apostrophe":"^6.0.2"},"_npmOperationalInternal":{"tmp":"tmp/db-connect_1.0.0-alpha.1_1776775887079_0.7077977731716205","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@apostrophecms/db-connect","version":"1.0.0","license":"MIT","_id":"@apostrophecms/db-connect@1.0.0","maintainers":[{"name":"alexgilbert","email":"alex@apostrophecms.com"},{"name":"boutell","email":"tom@apostrophecms.com"},{"name":"romanek","email":"stuart+npm@apostrophecms.com"},{"name":"bodonkey","email":"robert.means1969+apostrophecms@gmail.com"}],"bin":{"apos-db-dump":"bin/apos-db-dump.js","apos-db-restore":"bin/apos-db-restore.js"},"dist":{"shasum":"2a662a0a1035d7e47049c139656d62eff428013f","tarball":"https://registry.npmjs.org/@apostrophecms/db-connect/-/db-connect-1.0.0.tgz","fileCount":31,"integrity":"sha512-lO0uIpckIxwUfsOIbhS3rwA9Re6G0YWnYagB0fuprgdnkdklEobxGWGPQ4Z0G8LIa6ygkBKXYO/s5rpYy0r6GQ==","signatures":[{"sig":"MEYCIQCzPadXRtiA43InPImc9CKf3M/koMEilON4D6f3dcSUNQIhAK2+v2GjG0iUrZvmcAznNr+a9ugIVTFVDhWlvraoEE4Y","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":377515},"main":"index.js","_from":"file:apostrophecms-db-connect-1.0.0.tgz","scripts":{"lint":"eslint .","test":"mocha test/**/*.test.js --timeout 30000","eslint":"eslint .","test:sqlite":"ADAPTER=sqlite mocha test/**/*.test.js --timeout 30000","test:mongodb":"ADAPTER=mongodb mocha test/**/*.test.js --timeout 30000","test:postgres":"ADAPTER=postgres mocha test/**/*.test.js --timeout 30000"},"_npmUser":{"name":"bodonkey","email":"robert.means1969+apostrophecms@gmail.com"},"_resolved":"/private/var/folders/1r/s8d0zxkj0077spyr8jzvx2200000gn/T/d47174c77355606b65d0e88c6bfa58b1/apostrophecms-db-connect-1.0.0.tgz","_integrity":"sha512-lO0uIpckIxwUfsOIbhS3rwA9Re6G0YWnYagB0fuprgdnkdklEobxGWGPQ4Z0G8LIa6ygkBKXYO/s5rpYy0r6GQ==","_npmVersion":"11.5.1","description":"Database connection library and dump/restore tools for ApostropheCMS","directories":{},"_nodeVersion":"22.14.0","dependencies":{"pg":"^8.11.3","better-sqlite3":"^11.0.0","@apostrophecms/emulate-mongo-3-driver":"^1.0.6"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.3.10","mocha":"^11.7.1","eslint":"^9.39.1","eslint-config-apostrophe":"^6.0.2"},"_npmOperationalInternal":{"tmp":"tmp/db-connect_1.0.0_1780594096541_0.7827256817134014","host":"s3://npm-registry-packages-npm-production"}},"1.0.0-alpha.2":{"name":"@apostrophecms/db-connect","version":"1.0.0-alpha.2","license":"MIT","_id":"@apostrophecms/db-connect@1.0.0-alpha.2","maintainers":[{"name":"alexgilbert","email":"alex@apostrophecms.com"},{"name":"boutell","email":"tom@apostrophecms.com"},{"name":"romanek","email":"stuart+npm@apostrophecms.com"},{"name":"bodonkey","email":"robert.means1969+apostrophecms@gmail.com"}],"bin":{"apos-db-dump":"bin/apos-db-dump.js","apos-db-restore":"bin/apos-db-restore.js"},"dist":{"shasum":"c32d8dd72f44dc9e7a2555cdf607cc5d890cab03","tarball":"https://registry.npmjs.org/@apostrophecms/db-connect/-/db-connect-1.0.0-alpha.2.tgz","fileCount":31,"integrity":"sha512-ZwSLY5G3HFcLnk9iQTVfUEIDkqa7KKe6xT4o9cDTPkSBeJRmEbEeFfEzpJjRAIZuHTYKI47+8hXM+DUFS5IGQg==","signatures":[{"sig":"MEQCIAfJxRvHbOISwhk3kdI0IV+8pCnX7VsMHCgTScmuMmZUAiAn+P62/mtuZJK4V9hC6euXEWoSvmxa7mUZJp+SIncqIQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":377524},"main":"index.js","_from":"file:apostrophecms-db-connect-1.0.0-alpha.2.tgz","scripts":{"lint":"eslint .","test":"mocha test/**/*.test.js --timeout 30000","eslint":"eslint .","test:sqlite":"ADAPTER=sqlite mocha test/**/*.test.js --timeout 30000","test:mongodb":"ADAPTER=mongodb mocha test/**/*.test.js --timeout 30000","test:postgres":"ADAPTER=postgres mocha test/**/*.test.js --timeout 30000"},"_npmUser":{"name":"boutell","email":"tom@apostrophecms.com"},"_resolved":"/private/var/folders/lg/7k83x5ys71d90nvc40mj1tbr0000gn/T/7f27d3d9b7cfde09f96b61cc2a64fc30/apostrophecms-db-connect-1.0.0-alpha.2.tgz","_integrity":"sha512-ZwSLY5G3HFcLnk9iQTVfUEIDkqa7KKe6xT4o9cDTPkSBeJRmEbEeFfEzpJjRAIZuHTYKI47+8hXM+DUFS5IGQg==","_npmVersion":"11.12.0","description":"Database connection library and dump/restore tools for ApostropheCMS","directories":{},"_nodeVersion":"20.19.3","dependencies":{"pg":"^8.11.3","better-sqlite3":"^12.10.0","@apostrophecms/emulate-mongo-3-driver":"^1.0.6"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.3.10","mocha":"^11.7.1","eslint":"^9.39.1","eslint-config-apostrophe":"^6.0.2"},"_npmOperationalInternal":{"tmp":"tmp/db-connect_1.0.0-alpha.2_1781036314627_0.33953612288443447","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@apostrophecms/db-connect","version":"1.0.1","license":"MIT","_id":"@apostrophecms/db-connect@1.0.1","maintainers":[{"name":"alexgilbert","email":"alex@apostrophecms.com"},{"name":"boutell","email":"tom@apostrophecms.com"},{"name":"romanek","email":"stuart+npm@apostrophecms.com"},{"name":"bodonkey","email":"robert.means1969+apostrophecms@gmail.com"}],"bin":{"apos-db-dump":"bin/apos-db-dump.js","apos-db-restore":"bin/apos-db-restore.js"},"dist":{"shasum":"b1dcc33900b65ddaad30e1a3ef0ccf75c6aa3f8e","tarball":"https://registry.npmjs.org/@apostrophecms/db-connect/-/db-connect-1.0.1.tgz","fileCount":31,"integrity":"sha512-K+ZE0fNkgmwmHOJTDm9Cq+T92EnrUg1mUFHDWkSi04sL71QLWpAIc5lFPZa45f5swgqsVe+yQXTwS862O/rP8w==","signatures":[{"sig":"MEUCIFEm7ILnu+JcsWvAxypS3MMQymoXL9ap2nozBsyxDtbfAiEAlk3bL+xeeqEft+15rpnJIZCLEaeZv5VlQUMfAdKR8tE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":377516},"main":"index.js","_from":"file:apostrophecms-db-connect-1.0.1.tgz","scripts":{"lint":"eslint .","test":"mocha test/**/*.test.js --timeout 30000","eslint":"eslint .","test:sqlite":"ADAPTER=sqlite mocha test/**/*.test.js --timeout 30000","test:mongodb":"ADAPTER=mongodb mocha test/**/*.test.js --timeout 30000","test:postgres":"ADAPTER=postgres mocha test/**/*.test.js --timeout 30000"},"_npmUser":{"name":"boutell","email":"tom@apostrophecms.com"},"_resolved":"/private/var/folders/lg/7k83x5ys71d90nvc40mj1tbr0000gn/T/fbba5a2f4d1879db51ef858bf7eafa42/apostrophecms-db-connect-1.0.1.tgz","_integrity":"sha512-K+ZE0fNkgmwmHOJTDm9Cq+T92EnrUg1mUFHDWkSi04sL71QLWpAIc5lFPZa45f5swgqsVe+yQXTwS862O/rP8w==","_npmVersion":"11.12.0","description":"Database connection library and dump/restore tools for ApostropheCMS","directories":{},"_nodeVersion":"20.19.3","dependencies":{"pg":"^8.11.3","better-sqlite3":"^12.10.0","@apostrophecms/emulate-mongo-3-driver":"^1.0.6"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.3.10","mocha":"^11.7.1","eslint":"^9.39.1","eslint-config-apostrophe":"^6.0.2"},"_npmOperationalInternal":{"tmp":"tmp/db-connect_1.0.1_1781098422507_0.8469941738064324","host":"s3://npm-registry-packages-npm-production"}},"1.0.2-alpha.0":{"name":"@apostrophecms/db-connect","version":"1.0.2-alpha.0","license":"MIT","_id":"@apostrophecms/db-connect@1.0.2-alpha.0","maintainers":[{"name":"alexgilbert","email":"alex@apostrophecms.com"},{"name":"boutell","email":"tom@apostrophecms.com"},{"name":"romanek","email":"stuart+npm@apostrophecms.com"},{"name":"bodonkey","email":"robert.means1969+apostrophecms@gmail.com"}],"bin":{"apos-db-dump":"bin/apos-db-dump.js","apos-db-restore":"bin/apos-db-restore.js"},"dist":{"shasum":"0e84539a6d92253ec6cac752946a39a5d1757ae8","tarball":"https://registry.npmjs.org/@apostrophecms/db-connect/-/db-connect-1.0.2-alpha.0.tgz","fileCount":33,"integrity":"sha512-yYVffM2u0Ysa12D2JTAefeI3NEESk+U8LjVDGQl2fwu1WS/V6PU6BHiEH/V3pcPHJoLet5+itGU+cK2z47RjHg==","signatures":[{"sig":"MEUCIQDbS+Z36o8IECyinvj9yHVFJ3/dKT3qwPNTcK3wfTwMFAIgX2g+N+2cDo38/I22B64X2PdwLkGIQizMFUiad2HPhYg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":388102},"main":"index.js","_from":"file:apostrophecms-db-connect-1.0.2-alpha.0.tgz","scripts":{"lint":"eslint .","test":"mocha test/**/*.test.js --timeout 30000","eslint":"eslint .","test:sqlite":"ADAPTER=sqlite mocha test/**/*.test.js --timeout 30000","test:mongodb":"ADAPTER=mongodb mocha test/**/*.test.js --timeout 30000","test:postgres":"ADAPTER=postgres mocha test/**/*.test.js --timeout 30000"},"_npmUser":{"name":"boutell","email":"tom@apostrophecms.com"},"_resolved":"/private/var/folders/lg/7k83x5ys71d90nvc40mj1tbr0000gn/T/af7529771ef684f724a1d7b514025927/apostrophecms-db-connect-1.0.2-alpha.0.tgz","_integrity":"sha512-yYVffM2u0Ysa12D2JTAefeI3NEESk+U8LjVDGQl2fwu1WS/V6PU6BHiEH/V3pcPHJoLet5+itGU+cK2z47RjHg==","_npmVersion":"11.16.0","description":"Database connection library and dump/restore tools for ApostropheCMS","directories":{},"_nodeVersion":"24.18.0","dependencies":{"pg":"^8.11.3","better-sqlite3":"^12.10.0","@apostrophecms/emulate-mongo-3-driver":"^1.0.7"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.3.10","mocha":"^11.7.1","eslint":"^9.39.1","eslint-config-apostrophe":"^6.0.2"},"_npmOperationalInternal":{"tmp":"tmp/db-connect_1.0.2-alpha.0_1788382001435_0.4484676202106559","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@apostrophecms/db-connect","version":"1.0.2","description":"Database connection library and dump/restore tools for ApostropheCMS","license":"MIT","main":"index.js","bin":{"apos-db-dump":"bin/apos-db-dump.js","apos-db-restore":"bin/apos-db-restore.js"},"devDependencies":{"chai":"^4.3.10","eslint":"^9.39.1","mocha":"^11.7.1","eslint-config-apostrophe":"^6.0.2"},"dependencies":{"better-sqlite3":"^12.10.0","pg":"^8.11.3","@apostrophecms/emulate-mongo-3-driver":"^1.0.7"},"scripts":{"test":"mocha test/**/*.test.js --timeout 30000","test:mongodb":"ADAPTER=mongodb mocha test/**/*.test.js --timeout 30000","test:postgres":"ADAPTER=postgres mocha test/**/*.test.js --timeout 30000","test:sqlite":"ADAPTER=sqlite mocha test/**/*.test.js --timeout 30000","lint":"eslint .","eslint":"eslint ."},"_id":"@apostrophecms/db-connect@1.0.2","_integrity":"sha512-xR2x4IAkNQvHnV+YMSxyHxRooJXRQRFnNo3AmzsGtx1eKQIB4jwFsOZwXx0U+SPVu0xlAYdD89080284CxU97Q==","_resolved":"/private/var/folders/lg/7k83x5ys71d90nvc40mj1tbr0000gn/T/5605e26e6b836882856499790903a10c/apostrophecms-db-connect-1.0.2.tgz","_from":"file:apostrophecms-db-connect-1.0.2.tgz","_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-xR2x4IAkNQvHnV+YMSxyHxRooJXRQRFnNo3AmzsGtx1eKQIB4jwFsOZwXx0U+SPVu0xlAYdD89080284CxU97Q==","shasum":"617cc9b6bce3f45fb1e9ddf7176f0c9f29a40b41","tarball":"https://registry.npmjs.org/@apostrophecms/db-connect/-/db-connect-1.0.2.tgz","fileCount":33,"unpackedSize":385443,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDQl8Sh1bIvBLxdHlrEQqJ7Hisv3tWMzeodsvoG2p1P9gIhAOI6n65sokuw7Auepd3o3XvjkSXuQdam7gr5CKDymNWc"}]},"_npmUser":{"name":"boutell","email":"tom@apostrophecms.com"},"directories":{},"maintainers":[{"name":"alexgilbert","email":"alex@apostrophecms.com"},{"name":"boutell","email":"tom@apostrophecms.com"},{"name":"romanek","email":"stuart+npm@apostrophecms.com"},{"name":"bodonkey","email":"robert.means1969+apostrophecms@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/db-connect_1.0.2_1788450865963_0.626261556639848"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-21T12:51:26.915Z","modified":"2026-09-03T15:54:27.237Z","1.0.0-alpha.1":"2026-04-21T12:51:27.298Z","1.0.0":"2026-06-04T17:28:16.750Z","1.0.0-alpha.2":"2026-06-09T20:18:34.802Z","1.0.1":"2026-06-10T13:33:42.656Z","1.0.2-alpha.0":"2026-09-02T20:46:41.605Z","1.0.2":"2026-09-03T15:54:26.160Z"},"license":"MIT","description":"Database connection library and dump/restore tools for ApostropheCMS","maintainers":[{"name":"alexgilbert","email":"alex@apostrophecms.com"},{"name":"boutell","email":"tom@apostrophecms.com"},{"name":"romanek","email":"stuart+npm@apostrophecms.com"},{"name":"bodonkey","email":"robert.means1969+apostrophecms@gmail.com"}],"readme":"# @apostrophecms/db-connect\n\n`@apostrophecms/db-connect` defines the database connection API for [ApostropheCMS](https://apostrophecms.com). It provides adapters for MongoDB, PostgreSQL, and SQLite, and includes the `apos-db-dump` and `apos-db-restore` command-line utilities for database migration and backup.\n\nThe db-connect API is compatible with a large subset of the MongoDB API. However, after this introductory note, this document describes the **db-connect API** on its own terms. For projects that need to work across all three databases, it is necessary to use only the functionality defined here.\n\n## Supported Connection URLs\n\n### MongoDB\n\n```\nmongodb://localhost:27017/mydb\nmongodb+srv://user:pass@cluster.example.com/mydb\n```\n\nStandard MongoDB connection strings. The MongoDB adapter is a thin wrapper around the existing driver.\n\n### PostgreSQL\n\n```\npostgres://localhost:5432/mydb\n```\n\nSingle-database mode. All collections are stored as tables in the `public` schema.\n\n### SQLite\n\n```\nsqlite:///path/to/database.db\n```\n\nFile-based SQLite databases using `better-sqlite3`. The parent directory is\ncreated if it does not exist.\n\nUnlike the others, this is not really a URL: everything after `sqlite://` is a\n**filesystem path, taken exactly as written**. That matters, because\nfilesystem paths are not URLs — they are not percent-encoded, they may contain\ncharacters a URL parser treats as significant, and on Windows they begin with a\ndrive letter that a URL parser reads as `host:port`. So do not percent-encode\nthe path. A space is a space:\n\n```\nsqlite:///Users/jane/My Project/data/site.db\n```\n\n`%20` here means a literal percent, two, zero — not a space. Both absolute and\nrelative paths work, and on Windows both separators do:\n\n```\nsqlite:///var/lib/mysite/data.db          absolute (POSIX)\nsqlite://data/site.db                     relative to the working directory\nsqlite://C:\\Users\\jane\\site\\data\\site.db  absolute (Windows)\nsqlite://C:/Users/jane/site/data/site.db  absolute (Windows, forward slashes)\nsqlite:///C:/Users/jane/site/data/site.db absolute (Windows, file:// spelling)\n```\n\nIn-memory databases (`sqlite://:memory:`) are not supported — the adapter\nassumes a persistent store suitable for hosting an ApostropheCMS site.\n\n### Multi-Schema PostgreSQL (multipostgres)\n\n```\nmultipostgres://localhost:5432/shareddb-tenant1\n```\n\nDesigned for use with the ApostropheCMS [multisite](https://apostrophecms.com/extensions/multisite-2) module. In this mode, each site gets its own PostgreSQL schema within a single physical database.\n\nThe URL path is split at the **last hyphen**:\n\n- Everything before the last hyphen is the real PostgreSQL database name (`shareddb`)\n- Everything after is the schema name (`tenant1`)\n\nEach schema is created automatically on first use and dropped cleanly when the database is dropped. This provides true multi-tenant isolation — no cross-tenant data leakage — while sharing a single PostgreSQL instance efficiently.\n\n## Connecting\n\n```js\nconst connect = require('@apostrophecms/db-connect');\n\nconst client = await connect('postgres://localhost:5432/mydb');\nconst db = client.db();\nconst articles = db.collection('articles');\n\n// Insert a document\nconst result = await articles.insertOne({ title: 'Hello', status: 'draft' });\n\n// Query documents\nconst docs = await articles.find({ status: 'draft' })\n  .sort({ title: 1 })\n  .limit(10)\n  .toArray();\n\n// Update a document\nawait articles.updateOne(\n  { _id: result.insertedId },\n  { $set: { status: 'published' } }\n);\n\nawait client.close();\n```\n\n`connect(uri)` returns a client. Call `client.db()` to get a database, then `db.collection(name)` to get a collection.\n\n## Atomicity\n\n`insertOne` and `deleteOne` are always atomic.\n\n`updateOne` without `upsert` is atomic when it uses only the following operators:\n\n- **`$set`**, **`$inc`**, **`$unset`**, **`$currentDate`** — always atomic\n- **`$push`**, **`$pull`**, **`$addToSet`** — atomic when all values are **scalars** (strings, numbers, booleans). Object or array values fall back to read-modify-write.\n\nThese operators can be freely combined in a single `updateOne` call and the entire update will be atomic. This covers the most common patterns: counters, status flags, timestamps, field cleanup, and adding/removing items to/from arrays.\n\n**The following operations are NOT guaranteed to be atomic** and use a read-modify-write pattern (the document is read, the update is applied in JavaScript, and the result is written back):\n\n- `updateOne` with **`$rename`** or **`upsert: true`**\n- `updateOne` with `$push`, `$pull`, or `$addToSet` using **non-scalar** values\n- **`updateMany`**, **`findOneAndUpdate`**, and **`replaceOne`**\n\nFor operations that must be atomic and aren't covered above, use advisory locking (`apos.lock`) to serialize access. Apostrophe core already uses advisory locking where atomicity matters (e.g., `apos.lock.lock` around critical sections).\n\n## API Reference\n\n- [Database and Client](./docs/database.md) — `client.db(name)`, listing collections, dropping databases\n- [Collection Methods](./docs/collections.md) — CRUD operations, cursors, and bulk writes\n- [Query Operators](./docs/queries.md) — filtering documents with comparison, logical, element, and array operators\n- [Update Operators](./docs/updates.md) — modifying documents with `$set`, `$inc`, `$push`, and more\n- [Indexes](./docs/indexes.md) — creating and managing indexes, including numeric and date types\n- [Aggregation](./docs/aggregation.md) — pipeline stages and group accumulators\n- [Dump and Restore](./docs/dump-restore.md) — CLI tools and programmatic API for backup and migration\n","readmeFilename":"README.md"}