- Più recenti
- Maggior numero di voti
- Maggior numero di commenti
Take a look here:
https://docs.aws.amazon.com/appsync/latest/devguide/conflict-detection-and-sync.html
Versioned Data Source Metadata AWS AppSync manages metadata fields on Versioned data sources on your behalf. Modifying these fields yourself may cause errors in your application or data loss. These fields include:
_version
- A monotonically increasing counter that is updated any time that a change occurs to an item.
_lastChangedAt
- A numeric value that stores the timestamp, in epoch milliseconds, when an item was last modified.
_deleted
- A Boolean “tombstone” value that indicates that an item has been deleted. This can be used by applications to evict deleted items from local data stores.
_ttl
- A numeric value that stores the timestamp, in epoch seconds, when an item should be removed from the underlying data source.
ds_pk
- A string value that is used as the partition key for Delta tables.
ds_sk
- A string value that is used as the sort key for Delta tables.
These metadata fields will impact the overall size of items in the underlying data source. AWS AppSync recommends reserving 500 bytes + Max Primary Key Size of storage for versioned data source metadata when designing your application. To use this metadata in client applications, include the _version, _lastChangedAt, and _deleted fields on your GraphQL types and in the selection set for mutations.
Based on your code above, you are not providing a version in order to take advantage of conflict detection. You probably want to keep track of the version of the item as well and pass it into this method in addition to the idSht
parameter. Further down the page in the link above there are examples.
Hope this helps.
Contenuto pertinente
- AWS UFFICIALEAggiornata 2 anni fa
- AWS UFFICIALEAggiornata 2 anni fa
- AWS UFFICIALEAggiornata 2 anni fa