Should retrieve modified documents of a specified type from the Appwrite database by querying the timestamp.
TypeScript
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"
TL;DR
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.Recommended threads
- Display an in-app in the user mobile?
Would it be possible to send a message that would display an in-app in the user mobile?
- Swift SDK 13.2.2: Still getting ServiceC...
Hey team - I'm still getting ServiceContextModule linker errors even after updating to SDK 13.2.2. Error: - Undefined symbol: static ServiceContextModule.Servi...
- Still getting ServiceContextModule linke...
Hey team - I'm still getting ServiceContextModule linker errors even after updating to SDK 13.2.2. Error: - Undefined symbol: static ServiceContextModule.Servi...