Ranga ReddyOriginal post
Rank 1: Thread
Should retrieve modified documents of a specified type from the Appwrite database by querying the timestamp.
Swift
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"
Summary
Fetch modified documents of a specific type from the Appwrite database by querying the timestamp.
Error: Query value is invalid for the "$updatedAt" attribute.
Solution: Ensure the query value is appropriate for the "$updatedAt" attribute when querying for modified documents in Swift.