【发布时间】:2021-07-12 03:56:04
【问题描述】:
java.lang.NoSuchMethodError: kotlinx.coroutines.channels.LinkedListChannel: method ()V not found
这是我的数据库.kt
私有验证客户端 = KMongo.createClient().coroutine
私有 val 数据库 = client.getDatabase("PestaDanDagangDatabase")
私人验证用户 = database.getCollection()
私人 val 帖子 = database.getCollection()
暂停有趣的 getPostsForUser(email: String) : List {
return posts.find(Post::members 包含电子邮件).toList()
}
我正在关注一些教程... getPostsForUser 返回 Post 数据类的列表(它已经消失了.. 仍然需要学习使用 stackoverflow),即使我遵循相同的教程项目也在运行。我将返回更改为返回 posts.find(Post::members contains email).toString 并且函数返回 String 我的代码和我的教程结果都可以在邮递员中使用相同的响应 org.litote.kmongo.coroutine.CoroutineFindPublisher@44fc57b6(除了 44fc57b6)。
我尝试将返回更改为返回 posts.find(Post::members contains email) 和 Post 类型的函数返回类型 CoroutineFindPublisher,在邮递员中可以,但事件时间一直在计时或运行。
【问题讨论】:
-
能否提供相关代码?
-
是的,我只是编辑我的帖子,希望它变得更清晰。
-
刚刚意识到我的问题与身份验证无关..但仍然..抱歉。
-
我刚刚修复了它......我更新了所有实现......在此之前我重新安装了 intellij 和 ktor,但没有实现。谢谢你们。
标签: mongodb authentication postman ktor