Hey im pretty new to Spray and reactive mongo .
Im trying to return a list of result as json but i'm having some issue with converting the result to list of json.
this is my model
import reactivemongo.bson.BSONDocumentReader
import reactivemongo.bson.BSONObjectID
import reactivemongo.bson.Macros
case class Post(id: BSONObjectID, likes: Long, message: String, object_id: String, shares: Long)
object Post {
implicit val reader: BSONDocumentReader[Post] = Macros.reader[Post]
}and this is the route
val route1 = path("posts") { get{ respondWithMediaType(`application/json`) { val res: Future[List[Post]] = mongoService.getAll() onComplete(res) { case Success(value) => complete(value) case Failure(ex) => complete(ex.getMessage) } } } } error
type mismatch; found : List[com.example.model.Post] required: spray.httpx.marshalling.ToResponseMarshallablethanks,
miki
--
You received this message because you are subscribed to the Google Groups "spray.io User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spray-user+...@googlegroups.com.
Visit this group at http://groups.google.com/group/spray-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/spray-user/7e35848f-430e-4f0d-9b9d-968b0fa19e25%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
class DBDriver(dbUrls: Seq[String], dbName: String, system: Option[ActorSystem]) extends SprongoDB(dbUrls, dbName, system) {
object Post extends CollectionDAO[Post]("post")
}
not found: type SprongoDB
too many arguments for constructor Object: ()Object
not found: type CollectionDAO