Closed
Description
New Feature / Enhancement Checklist
- I am not disclosing a vulnerability.
- I am not just asking a question.
- I have searched through existing issues.
Current Limitation
The PostgresAdapter doesn't support the relativeTime
query constraint. Currently, the mongo adapter supports it.
Feature / Enhancement Description
Relative time queries allows devs to query dates based on strings, i.e. '1 day ago'
Example Use Case
Using the Swift SDK:
let constraint = relative("updatedAt" <= "3 days ago")
let query = GameScore.query(constraint)
do {
let recentObjects = try await query.find()
print(recentObjects)
} catch {
// Handle error
}
Alternatives / Workarounds
Specify query constraints on dates directly.
3rd Party References
The parse-server already supports this for Mongo:
parse-server/spec/ParseQuery.spec.js
Lines 4769 to 4868 in 4c29d4d