
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
- Realtime Disconnects and Error: INVALID_...
Hi! I just want to ask here if there's any workaround with the disconnect issues we're encountering when subscribing to realtime events in react native using ex...
- Appwrite documents and Swift codable
The object I use to create a document is different than the object I receive when I list documents. Do I create an object that’s used to create a document and a...
- Swift: Response from .deleteDocument
According to the docs, in Swift when calling `databases.deleteDocument` the response is supposed to be 204 (No Content). However, we are finding the response is...
