''' suspend fun currentAffairs(date: String): Resource<List<CurrentAffairsData>> { return withContext(Dispatchers.IO) { try { val affairs = arrayListOf<CurrentAffairsData>()
TypeScript
val response = database.listDocuments(
databaseId = appwriteConstants.DATABASE_ID,
collectionId = appwriteConstants.CURRENT_AFFAIRS_COLLECTION_ID,
queries = listOf(
Query.limit(limitMax),
Query.equal("\$createdAt", date)
)
).documents
response.forEach {
affairs.add(CurrentAffairsData.fromMap(it.data, it.id, it.createdAt))
}
Resource.Success(affairs)
} catch (e: Exception) {
Resource.Error(e.message ?: "An error occurred")
}
}
}'''
TL;DR
Developers are requesting assistance with fetching data based on a specific date in their currentAffairs function. They are attempting to query the database for documents created on a particular date but are not getting the desired results.Recommended threads
- {"code": 1008, "message": "Invalid Origi...
Nothing has changed in my application or console settings so I'm curious as to what I need to do to fix this. I already have the client registered so I'm not en...
- android platform invaild origina
It happened today suddenly. Our app says invalid origin. And appwrite cloud says every time we tried to add the app to it: "param platformId" is not optional.
- All my apps are not opening now
All my apps are not opening now 200+ apps are not opening plz fast