''' 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
- I'm experiencing a critical bug on Appwr...
Hey <@870607367597850624> team / support π I'm experiencing a critical bug on Appwrite Cloud that's blocking my production Flutter app. I've already filed GitH...
- Database listRows method call failing in...
I'm getting an error when trying to use listRows in a flutter app on a database. It seems something in the backend has changed because the production version of...
- Google's "Choose an account" screen stuc...
I've been struggling with this problem on my servers (self hosted 1.6.0 & 1.7.4) , multiple projects , multiple apps , and I think I have reached a very strange...