Questions tagged [reactivemongo]

Asynchronous & Non-Blocking Scala Driver for MongoDB

508 questions
22
votes
2 answers

Why does Future's recover not catch exceptions?

I'm using Scala, Play Framework 2.1.x, and reactivemongo driver. I have an api call : def getStuff(userId: String) = Action(implicit request => { Async { UserDao().getStuffOf(userId = userId).toList() map { stuffLst =>…
samz
  • 1,592
  • 3
  • 21
  • 37
19
votes
5 answers

No Json serializer as JsObject found for type play.api.libs.json.JsObject

I have the following code that works in a console app when referencing "org.reactivemongo" %% "play2-reactivemongo" % "0.10.5.0.akka23" when I update the reference to "org.reactivemongo" % "play2-reactivemongo_2.11" % "0.11.0.play23-M3" I get: No…
Greg R
  • 1,670
  • 4
  • 26
  • 46
14
votes
1 answer

How is ReactiveMongo implemented so that it is considered non-blocking?

Reading the documentation about the Play Framework and ReactiveMongo leads me to believe that ReactiveMongo works in such a way that it uses few threads and never blocks. However, it seems that the communication from the Play application to the…
illabout
  • 3,517
  • 1
  • 18
  • 39
11
votes
6 answers

MongoError No primary node is available

We have upgraded to Play 2.7.0 recently and use play2-reactivemongo version 0.16.2 with reactivemongo 0.16.3. We use reactivemongo-shaded-native but also tried without. We are connecting to a replica set with 3 nodes, MongoDB 3.6.10 on MongoDB…
cbley
  • 4,538
  • 1
  • 17
  • 32
10
votes
1 answer

How to resolve this exception

This Exception invoked and not able to resolved it ... Error:scalac: missing or invalid dependency detected while loading class file 'GenericCollection.class'. Could not access term play in package , because it (or its dependencies) are…
panky
  • 137
  • 1
  • 1
  • 10
10
votes
2 answers

Play: How to transform JSON while writing/reading it to/from MongoDB

Here is an simple JSON I want to write/read to/from MongoDB: { "id": "ff59ab34cc59ff59ab34cc59", "name": "Joe", "surname": "Cocker" } Before storing it in MongoDB, "ff59ab34cc59ff59ab34cc59" has to be transformed into an ObjectID and id…
j3d
  • 9,492
  • 22
  • 88
  • 172
9
votes
2 answers

Akka and ReactiveMongo

I am trying to find the best approach to sharing the same pool of connection between actors withing the cluster workers. I have the following structure: Master Actor -> Worker Actors(can be up to 100 or more) -> MongoDB Between workers and MongoDB I…
Alex K
  • 854
  • 9
  • 16
9
votes
2 answers

No Json deserializer found for type Option[reactivemongo.bson.BSONObjectID]

I'm getting a: No Json deserializer found for type Option[reactivemongo.bson.BSONObjectID]. Try to implement an implicit Reads or Format for this type. When trying to deserialise my review object. Review: case class Review(override var id:…
jakob
  • 5,979
  • 7
  • 64
  • 103
8
votes
3 answers

Play 2.3.5 and ReactiveMongo: MongoError['No primary node is available!']

I recently upgraded Play to version 2.3.5 and try to use it with ReactiveMongo. However everytime I try to read data from mongoDB an exception occurred. This is my build.sbt: name := """ReactiveMongoRestExample""" version := "1.0-SNAPSHOT" lazy…
trollr
  • 1,095
  • 12
  • 27
8
votes
1 answer

Play ReactiveMongo - exception when trying to find one document

I've started using Play and the Play-ReactiveMongo plugin and testing for a 404 response on a GET "document by id" scenario. Unfortunately instead of Play returning a 404 NotFound response I get this exception: java.util.NoSuchElementException:…
reggoodwin
  • 1,514
  • 13
  • 14
7
votes
3 answers

How to handle MongoDB ObjectIds in Play framework using Reactivemongo?

I have a basic model with a case class case class Record( id: Option[String], data: Double, user: String, ) object RecordJsonFormats { import play.api.libs.json.Json implicit val recordFormat…
PovilasID
  • 883
  • 10
  • 34
7
votes
1 answer

Getting the error "play-iteratees_2.10 not found" after adding the reactivemongo

I've started to learn reactivemongo by creating a simple Scala project. I started with SBT. Here is my build.sbt file: name := "mongo-test" version := "1.0" scalaVersion := "2.10.2" libraryDependencies ++= Seq( "org.reactivemongo" %%…
Amir Karimi
  • 5,401
  • 4
  • 32
  • 51
6
votes
0 answers

How to set the write concern for insert query with ReactiveMongo

How can I write the following query in ReactiveMongo. db.products.insert( { item: "envelopes", qty : 100, type: "Clasp" }, { writeConcern: { w: 2, wtimeout: 5000 } } ) I have tried the like…
newbie
  • 456
  • 1
  • 6
  • 17
6
votes
0 answers

ReactiveMongo Channel not found from the primary node

We are having an issue on one of our production systems and for the life of us can not find a solution to it 2017-08-22 19:15:52.337 [Supervisor-1/Connection-2] Got an error, no more attempts to do. Completing with a failure...…
Deadcore
  • 61
  • 2
6
votes
1 answer

Strange MongoError (with ReactiveMongo) when Play reloads application

Very often, when Play reloads the application after a code change, I receive the following error: MongoError['The node set can not be reached! Please check your network connectivity.'] The MongoDB log looks like…
1
2 3
33 34