Скала я попыталсяне может получить список [String] из будущего [Список [String]]
complete(db[BSONCollection("user").find(BSONDocument()).cursor[UserObject].collect[List]().toJson)
я попробовал это, но я не работаю он дает мне ошибку
Main.scala:101: Cannot find JsonWriter or JsonFormat type class for scala.concurrent.Future[Option[UserObject]]
[error] complete(Themodel.get().toJson)
я пытался
complete(collection.find(emptyQuery).cursor[BSONDocument].collect[List]() map{ t => OK -> t})
, но он дает мне ошибку
found : scala.concurrent.Future[(akka.http.scaladsl.model.StatusCodes.Success, Option[UserObject])]
[error] required: spray.httpx.marshalling.ToResponseMarshallable
[error] complete(Themodel.get() map{
[error] ^