Where an accessor exists on a partition key, the key is passed through the accessor prior to query being executed, resulting in queries that can be incorrect.
Schema
Primary key: siteSensor (string)
Partition key: dateFrom (string)
No GSI
Note that the date string is being passed into the mutator first, then back to the accessor. Changing the date input string to 2020-11-01 does not make a difference since it still gets fed to the accessor.
Throwing a stack trace in the accessor shows that at vendor/baopham/dynamodb/src/DynamoDbModel.php:386 the following call is made, which subsequently passed the values throw the accessors:
$key[$name] = $this->getAttribute($name); Version info
Describe the bug
Where an accessor exists on a partition key, the key is passed through the accessor prior to query being executed, resulting in queries that can be incorrect.
Schema
Primary key: siteSensor (string) Partition key: dateFrom (string) No GSI
In the Eloquent model:
I also use typical date mutator/accessor to convert from European dd/mm/YYYY to/from YYYY-mm-dd
Debug info
Show the query that you're having trouble with by copy-pasting the result of:
Note that the date string is being passed into the mutator first, then back to the accessor. Changing the date input string to 2020-11-01 does not make a difference since it still gets fed to the accessor.
Throwing a stack trace in the accessor shows that at vendor/baopham/dynamodb/src/DynamoDbModel.php:386 the following call is made, which subsequently passed the values throw the accessors:
$key[$name] = $this->getAttribute($name);
Version info