Cache additional routes: people/by-year and people/by-name#471
Merged
windauer merged 1 commit intoHistoryAtState:masterfrom Jan 22, 2025
Merged
Cache additional routes: people/by-year and people/by-name#471windauer merged 1 commit intoHistoryAtState:masterfrom
windauer merged 1 commit intoHistoryAtState:masterfrom
Conversation
line-o
commented
Jan 21, 2025
joewiz
reviewed
Jan 21, 2025
Contributor
Author
|
@joewiz I just did a small test in docker and all three implementations of the function did perform equally well: That means we can choose the one that is most readable to us. As I prefer the first one and I think you do too this is the one I changed it to. declare variable $local:POCOM_PEOPLE_COL := '/db/apps/pocom/people';
declare function local:pocom-people-last-modified() as xs:dateTime {
collection($local:POCOM_PEOPLE_COL)//last-modified-date
=> sort() => reverse() => head() => concat("T00:00:00Z") => xs:dateTime()
};
declare function local:pocom-people-last-modified-2() as xs:dateTime {
xs:dateTime(concat(
head(reverse(sort(collection($local:POCOM_PEOPLE_COL)//last-modified-date))) ,"T00:00:00Z"))
};
declare function local:pocom-people-last-modified-3() as xs:dateTime {
head(
for $raw-date in collection($local:POCOM_PEOPLE_COL)//last-modified-date
let $date := xs:dateTime($raw-date || "T00:00:00Z")
order by $date descending
return $date
)
};
local:pocom-people-last-modified-2() |
Use the last-modified-date metadatum in the relevant collection to calculate the collection wide last modified date.
090b1d6 to
d3e0fca
Compare
Member
|
@line-o Great! In that case, I agree that the 1st option is the most readable. Thank you! |
joewiz
approved these changes
Jan 22, 2025
|
🎉 This PR is included in version 3.7.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
needs