Krishanu singh
''' 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
- custom domain with CloudFlare
Hi all, it seems that CloudFlare has blocked cross-domain CNAME link which made my app hostname which is in CloudFlare, unable to create a CNAME pointing to clo...
- My organization's project is blocked
My organization's project is blocked so unblocked my organization then I will this
- Can't Create An Account with Gmail Domai...
Hi, when using account.create() to register a new user with the Gmail domain, I got "There was an error processing your request. Please check the inputs and try...