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
- Error: User (role: guests) missing scope...
I want to send a verification code to the user and the given phone number and check it and create a session right after the user entered the secret. For me that...
- Sign In With Apple OAuth Help
Hi All! I've got a flutter & appwrite app which Im trying to use sign in with apple for. I already have sign in with google working and the function is the sam...
- How to verify an user using AppWrite Fun...
I have seen similar questions but none whose solutions serve me. I have a function to verify a user with their secret and their id: https://blahblah.appwrite.gl...