''' 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
- Server Down
Appwrite services are down. When will they start working again?
- Use Limits
I need urgent help, i use appwrite as a chat function for my website and my mobile android application, but recently, for the past 3 months, my database reaches...
- redirect uri not working for OAuth with ...
I'm following this tutorial: https://appwrite.io/blog/post/google-oauth-expo#create-an-expo-app but im using an android development build instead. When I run h...