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 insertedDate and lastModifiedDate to attributes and document attributes #286

Open
reganwolfrom opened this issue Oct 25, 2024 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@reganwolfrom
Copy link
Member

reganwolfrom commented Oct 25, 2024

It appears that attributes and document attributes do not have insertedDate and lastModifiedDate properties; ideally, these would be included with the resources themselves directly (DynamoDB and API).

@reganwolfrom reganwolfrom added the enhancement New feature or request label Oct 25, 2024
@mfriesen
Copy link
Member

@reganwolfrom Which API endpoints are you referring to?

@reganwolfrom
Copy link
Member Author

@reganwolfrom Which API endpoints are you referring to?

@mfriesen I see that insertedDate now exists on GET /documents/{documentId}/attributes and GET /documents/{documentId}/attributes/{attributeKey}, but would like lastModifiedDate, if possible.

GET /attributes does not have an insertedDate or lastModifiedDate (though possibly lastModifiedDate makes no sense, and this is probably not as important as document attributes.

@mfriesen
Copy link
Member

mfriesen commented Nov 6, 2024

LastModifiedDate is tricky because the LastModifiedDate is tied to the AttributeKey + AttributeValue. So on GET /documents/{documentId}/attributes/{attributeKey} when stringValue(s) is returned there's no way to say value1 was lastmodified on date X and value2 was lastmodified on date Y. So technically InsertedDate could be incorrect but typically values are inserted at the same time and this was the compromise made

@reganwolfrom
Copy link
Member Author

@mfriesen you mean that the compromise is to only provide insertedDate, since the assumption is that lastModifiedDate is usually the same date, but it's not always possible to validate that or provide an alternate value?

@mfriesen
Copy link
Member

mfriesen commented Nov 6, 2024

Document Attributes are saved as:
<inserted_date1>
<inserted_date2>

If you added last modified date
<inserted_date1> <last_modified_date1>
<inserted_date2> <last_modified_date2>

The API returns
{
"attributes: [
"key":"attribute1",
"stringValues":[value1, value2],
"insertedDate". <-- this is where the compromise is.. really it should be returning "insertedDates":[<inserted_date1>, <inserted_date2>],
]
}

Last modified date on the attribute is tricky. If you update , do you update the last modified date for ALL attributes?

@reganwolfrom
Copy link
Member Author

@mfriesen I think there are two questions here:

  1. is there data storing last modified on each value change, and is it granular enough to not each specific value in a list of values?
  2. if so, is there a good way to expose that in the API?

I think the first question is what matters, vs. API responses, which could always have additional properties provided as an array of objects, but obviously that shouldn't remove the lovely array of strings (or numbers) you get now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants