Skip to content

Commit 22f2028

Browse files
committed
Further tweak mongodb permissions.
1 parent 1e1fa85 commit 22f2028

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

README.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,16 @@ There is also a WYSIWYG editor available in our [Mintlify dashboard](https://das
1212

1313
### Development
1414

15-
Install the [Mintlify CLI](https://www.npmjs.com/package/mintlify) to preview the documentation changes locally. To install, use the following command
16-
17-
```
18-
npm i -g mintlify
19-
```
20-
2115
Run the following command at the root of your documentation (where mint.json is)
2216

2317
```
24-
mintlify dev
18+
npx mintlify dev
2519
```
2620

2721
Regularly check for broken links by running
2822

2923
```
30-
mintlify broken-links
24+
npx mintlify broken-links
3125
```
3226

3327
Navigation (and other global settings) is defined in `mint.json`. Learn more about these in [Mintlify's docs](https://mintlify.com/docs/settings/global).

installation/database-setup.mdx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -356,20 +356,29 @@ replicated collections, additionally add the `dbAdmin` permission:
356356

357357
```
358358
readWrite@<your_database>._powersync_checkpoints
359+
read@<your_database>
359360
dbAdmin@<your_database>
360361
```
361362

362-
If you are replicating from multiple databases in the cluster, you need read permissions on the entire cluster:
363+
If you are replicating from multiple databases in the cluster, you need read permissions on the entire cluster, in addtion to the above:
363364

364365
```
365366
readAnyDatabase@admin
366367
```
367368

368-
### Permissions required - Self-hosted
369+
### Privileges required - Self-hosted / Custom roles
370+
371+
For self-hosted MongoDB, or for creating custom roles on MongoDB Atlas, PowerSync requires the following privileges/granted actions:
369372

370-
For self-hosted MongoDB, PowerSync requires the `find`, `changeStream` and `listCollections` permissions on the database being replicated.
373+
* On the database being replicated: `listCollections`.
374+
* On all collections in the database: `changeStream`.
375+
* This must apply to the entire database, not individual collections, `collection: ""`.
376+
* If replicating from multiple databases, this must apply to the entire cluster, `db: ""`.
377+
* On each collection being replicated: `find`.
378+
* On the `_powersync_checkpoints` collection: `createCollection`, `dropCollection`, `find`, `changeStream`, `insert`, `update`, and `remove`.
379+
* To allow PowerSync to automatically enable [`changeStreamPreAndPostImages`](#post-images) on
380+
replicated collections, additionally add the `collMod` permission all replicated collections.
371381

372-
PowerSync also requires `createCollection`, `dropCollection`, `insert`, `update`, and `remove` permissions to the `_powersync_checkpoints` collection.
373382

374383
### Post-Images
375384

0 commit comments

Comments
 (0)