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

Add docs for new consistent parameter #459

Open
wants to merge 1 commit into
base: master
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
1 change: 0 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2537,7 +2537,6 @@ export interface QueryOptions {
logger?: ElectroEventListener;
data?: "raw" | "includeKeys" | "attributes";
order?: "asc" | "desc";

consistent?: boolean;
}

Expand Down
2 changes: 2 additions & 0 deletions www/src/pages/en/queries/batch-get.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ By default, **ElectroDB** enables you to work with records as the names and prop
listeners Array<(event) => void>;
preserveBatchOrder?: boolean;
attributes?: string[];
consistent?: boolean;
};
```

Expand All @@ -124,3 +125,4 @@ By default, **ElectroDB** enables you to work with records as the names and prop
| listeners | `[]` | An array of callbacks that are invoked when [internal ElectroDB events](/en/reference/events-logging) occur. |
| logger | _none_ | A convenience option for a single event listener that semantically can be used for logging. |
| preserveBatchOrder | `false` | When used with a [batchGet](/en/queries/batch-get) operation, ElectroDB will ensure the order returned by a batchGet will be the same as the order provided. When enabled, if a record is returned from DynamoDB as "unprocessed" ([read more here](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_BatchGetItem.html)), ElectroDB will return a null value at that index. |
| consistent | _none_ | When set to `true`, DynamoDB will return the most up-to-date data reflecting updates from all prior write operations using DynamoDB's [`ConsistentRead`](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadConsistency.html#HowItWorks.ReadConsistency.Strongly) parameter. Strongly consistent reads are only supported on tables and local secondary indexes. |
24 changes: 13 additions & 11 deletions www/src/pages/en/queries/get.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,19 @@ By default, **ElectroDB** enables you to work with records as the names and prop
logger?: (event) => void;
listeners Array<(event) => void>;
attributes?: string[];
consistent?: boolean;
};
```

| Option | Default | Description |
| --------------- | :------------------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| params | `{}` | Properties added to this object will be merged onto the params sent to the document client. Any conflicts with **ElectroDB** will favor the params specified here. |
| table | _(from constructor)_ | Use a different table than the one defined in the [Service Options](/en/modeling/service#options) |
| attributes | _(all attributes)_ | The `attributes` query option allows you to specify ProjectionExpression Attributes for your `get` or `query` operation. As of `1.11.0` only root attributes are allowed to be specified. |
| data | `"attributes"` | Accepts the values `'raw'`, `'includeKeys'`, `'attributes'` or `undefined`. Use `'raw'` to return query results as they were returned by the docClient. Use `'includeKeys'` to include item partition and sort key values in your return object. By default, **ElectroDB** does not return partition, sort, or global keys in its response. |
| originalErr | `false` | By default, **ElectroDB** alters the stacktrace of any exceptions thrown by the DynamoDB client to give better visibility to the developer. Set this value equal to `true` to turn off this functionality and return the error unchanged. |
| response | `"default"` | Used as a convenience for applying the DynamoDB parameter `ReturnValues`. The options here are the same as the parameter values for the DocumentClient except lowercase. The `"none"` option will cause the method to return null and will bypass ElectroDB's response formatting -- useful if formatting performance is a concern. |
| ignoreOwnership | `false` | By default, **ElectroDB** interrogates items returned from a query for the presence of matching entity "identifiers". This helps to ensure other entities, or other versions of an entity, are filtered from your results. If you are using ElectroDB with an existing table/dataset you can turn off this feature by setting this property to `true`. |
| listeners | `[]` | An array of callbacks that are invoked when [internal ElectroDB events](/en/reference/events-logging) occur. |
| logger | _none_ | A convenience option for a single event listener that semantically can be used for logging. |
| Option | Default | Description |
| --------------- | :------------------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| params | `{}` | Properties added to this object will be merged onto the params sent to the document client. Any conflicts with **ElectroDB** will favor the params specified here. |
| table | _(from constructor)_ | Use a different table than the one defined in the [Service Options](/en/modeling/service#options) |
| attributes | _(all attributes)_ | The `attributes` query option allows you to specify ProjectionExpression Attributes for your `get` or `query` operation. As of `1.11.0` only root attributes are allowed to be specified. |
| data | `"attributes"` | Accepts the values `'raw'`, `'includeKeys'`, `'attributes'` or `undefined`. Use `'raw'` to return query results as they were returned by the docClient. Use `'includeKeys'` to include item partition and sort key values in your return object. By default, **ElectroDB** does not return partition, sort, or global keys in its response. |
| originalErr | `false` | By default, **ElectroDB** alters the stacktrace of any exceptions thrown by the DynamoDB client to give better visibility to the developer. Set this value equal to `true` to turn off this functionality and return the error unchanged. |
| response | `"default"` | Used as a convenience for applying the DynamoDB parameter `ReturnValues`. The options here are the same as the parameter values for the DocumentClient except lowercase. The `"none"` option will cause the method to return null and will bypass ElectroDB's response formatting -- useful if formatting performance is a concern. |
| ignoreOwnership | `false` | By default, **ElectroDB** interrogates items returned from a query for the presence of matching entity "identifiers". This helps to ensure other entities, or other versions of an entity, are filtered from your results. If you are using ElectroDB with an existing table/dataset you can turn off this feature by setting this property to `true`. |
| listeners | `[]` | An array of callbacks that are invoked when [internal ElectroDB events](/en/reference/events-logging) occur. |
| logger | _none_ | A convenience option for a single event listener that semantically can be used for logging. |
| consistent | _none_ | When set to `true`, DynamoDB will return the most up-to-date data reflecting updates from all prior write operations using DynamoDB's [`ConsistentRead`](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadConsistency.html#HowItWorks.ReadConsistency.Strongly) parameter. Strongly consistent reads are only supported on tables and local secondary indexes. |
Loading
Loading