Questions tagged [play-reactivemongo]

Play-ReactiveMongo is a plugin for Play 2.x, enabling support for ReactiveMongo – reactive, asynchronous and non-blocking Scala driver for MongoDB.

148 questions
0
votes
1 answer

NullPointerException when testing controller in Play 2.6

I'm working on a Scala Play 2.6 application that uses ReactiveMongo. I've followed the example of HomeControllerSpec.scala of the default Play 2.6 installation (play-scala-seed.g8) to test my ProjectController by creating a new instance of it but I…
0
votes
0 answers

Equivalent BSON Document query

I am trying aggregate query in mongo database. I could find the command for aggregate in command line as well in robomongo. Please find query below db.portfolio.aggregate([ { $match: {id: "c-4fbfd8ed-8b4a-4cf6-b3e0-2f5f3200d6d4"}}, {…
0
votes
1 answer

Play Reactive Mongo Plugin for Play 2.4 and ReactiveMongo 0.13

The latest version of Mongo is 3.6. My project is somewhere in the bronze-age with version 2.6. We are still at Play 2.4, using the reactive mongo plugin "org.reactivemongo" %% "play2-reactivemongo" % "0.11.11-play24". Reactive Mongo's website…
Serendipity
  • 1,015
  • 1
  • 10
  • 19
0
votes
1 answer

when I upgraded my ReactiveMongo library dependencies from 0.11.0.play24 to 0.11.14-play24 it throws me error

I'am upgrading the play from 2.4.3 to 2.5.2 in the process I was able to upgrade the play but when I upgraded the reactive mongo library dependency from 0.11.0.play24 to 0.11.14-play24 it was throwing following errors found : (String,…
0
votes
1 answer

Dependency injection issue for ReactiveMongo in Play 2

I'm building a web app using Play 2.6 and ReactiveMongo 0.13. But when I try to run the app, I get this output: ProvisionException: Unable to provision, see the following errors: 1) No implementation for play.modules.reactivemongo.ReactiveMongoApi…
eje211
  • 2,385
  • 3
  • 28
  • 44
0
votes
1 answer

find with reactive mongo and play framework

I want to retrieve a user's data by his mail from MongoDB using ReactiveMongo driver for play framework but it returns: Future() Here is my code: def findBymail(email: String) = { val query = Json.obj("mail" -> email) val resul =…
0
votes
1 answer

Update with Raw Command in ReactiveMongo 0.12.5

I am not currently able to run a Raw Command in ReactiveMongo 0.12.5 using the Play JSON Plugin. The documentation (Run a raw command) is not currently accessible but from a cached page in my browser I can see the following: import…
0
votes
0 answers

How to use $in mongo query with ReactiveMongo in Play! Framework 2.6?

I am trying to use the following find query, { "uid" : { "$in" : ["value1", "value2"] } } The array ["value1", "value2"] should be set dynamically from Scala Array[String]. Here is my code, def find(uids: Array[String]): Future[Seq[User]] =…
0
votes
1 answer

ReactiveMongo Macros.handler crashes after new field is added

I recently add a new field to my scala case class since I want to start keeping track of that field in my MongoDB. let's say case class is like this: case class MyItem ( var existingField: String, var newlyAddedField: String ) { } I use this…
Zennichimaro
  • 5,236
  • 6
  • 54
  • 78
0
votes
0 answers

injection error when running test with sbt

In a play 2.6.7 scala project with reactivemongo, I am having an issue. When I run a test case through IntelliJ idea (CE)'s test runner, it runs without problems. But when I try to run the same test case from command line using sbt it fails. This…
mcku
  • 1,351
  • 12
  • 23
0
votes
0 answers

How to get a result from FindAndModifyResult?

I'm using Play Framework 2.5 and play2-reactivemongo v0.12.4. Trying to create auto-increment counter using findAndUpdate. (I tried using findAndModify. But, I'd no idea how to create one of parameter "commands.JSONFindAndModifyCommand.Modify") And…
Uske
  • 173
  • 1
  • 1
  • 8
0
votes
0 answers

ReactiveMongo and Play framework: error ConnectionNotInitialized

I'm trying to follow the tutorial of "reactiveMongo" with play framework and scala, but I get the following error: [ConnectionNotInitialized: MongoError['Connection is missing metadata (like protocol version, etc.) The connection pool is probably…
user7371424
0
votes
2 answers

ReactiveMongo conditional update

I am confused on how one would conditionally update a document based on a previous query using only futures. Let say I want to push to some value into an array in a document only if that array has a size less than a given Integer. I am using this…
stacktraceyo
  • 1,235
  • 4
  • 16
  • 22
0
votes
1 answer

Reactivemongo - BSONObjectID and BSONDateTime Insertion

I'm using play2.5 + play2-reactivemongo 0.12.3. BSONObjectID is inserted as array and BSONDateTime is inserted as NumberLong on mongoDB with following codes. > db.Example.find() { "_id" : { "array" : [ 89, 55, -10, 60, -40, 0, 0, -61, 0, -94, 126,…
Uske
  • 173
  • 1
  • 1
  • 8
0
votes
0 answers

How to define implicit Play ReactiveMongo handler for type parameter?

I'm new to scala and using play2.5 + play2-reactivemongo 0.12.3. now trying to create a base DAO trait as below. trait BaseDAO[T] { val collectionName: String def reactiveMongoApi: ReactiveMongoApi lazy val collection =…
Uske
  • 173
  • 1
  • 1
  • 8