Should retrieve modified documents of a specified type from the Appwrite database by querying the timestamp.
func fetchModifiedDocuments<T: Codable>(
collectionId: String,
since timestamp: TimeInterval
) async throws -> [AppwriteModels.Document<T>] {
do {
let query = Query.greaterThan("$updatedAt", value: timestamp)
let documents = try await databases.listDocuments(
databaseId: AppwriteConstants.DATABASE_ID,
collectionId: collectionId,
queries: [query],
nestedType: T.self
)
return documents.documents
} catch {
print("Error fetching modified documents: \(error.localizedDescription)")
throw error
}
}
Error
Error fetching modified documents: Invalid query: Query value is invalid for attribute "$updatedAt" Error fetching decks: Invalid query: Query value is invalid for attribute "$updatedAt"
Recommended threads
- Apple Sign In: No name returned and hide...
Hi there, I am currently exploring apple sign in using Appwrite. Google works great, but when I log in using my apple ID there is no name returned. Both the fi...
- Need help getting currentUser by Account...
Hey im having some troubles with getting the currentUser. I managed to get the Account with account.get but when i want to do this to get the currentUser the ob...
- Swift 6 Compatibility
Just curious if anyone with an Appwrite & iOS/WatchOS project written with swift, has successfully upgraded to Swift 6. I am finding it a little difficult.