Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak collections docs to make CLI usage clearer #602

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions adaptors/collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ fn(state => {

:::info

Improved Collections support is coming to the CLI soon.
Improved Collections support is coming to the CLI soon!

:::

Expand Down Expand Up @@ -290,7 +290,7 @@ You'll need to set configuration on the state.json:
{
"configuration": {
"collections_endpoint": "http://localhost:4000/collections",
"collections_token": "...paste the token from the app..."
"collections_token": "...paste your Personal Access Token..."
}
}
```
Expand All @@ -306,7 +306,7 @@ If you're using `workflow.json`, set the token and endpoint on
"steps": [ ... ],
"credentials": {
"collections_endpoint": "http://localhost:4000/collections",
"collections_token": "...paste the token from the app..."
"collections_token": "...paste your Personal Access Token..."
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion docs/build/collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ collections.each(
);
```

New values are uploaded to a collection through `collections.set`:
Values are uploaded to a collection through `collections.set`. All sets are "upserts" - meaning that new keys will be created for values that don't exist, and values will be updated for keys that _do_ exist.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a second tweak after speaking with Benson today


The example below sets a single item:

```js
collections.set('openfn-demo', 'commcare-fhir-value-mappings', {
Expand All @@ -115,6 +117,7 @@ collections.set('openfn-demo', 'commcare-fhir-value-mappings', {
});
```


## Managing Collections

Collections can be created, destroyed or renamed from the Admin menu.
Expand Down