Play-ReactiveMongo is a plugin for Play 2.x, enabling support for ReactiveMongo – reactive, asynchronous and non-blocking Scala driver for MongoDB.
Questions tagged [play-reactivemongo]
148 questions
3
votes
3 answers
Compile error on a Future[Option[BasicProfile]] method in play
i'm writing a play 2.3 application using secure social and reactivemongo library, with scala.
Now i'm trying to implement the UserService[T] trait but i'm getting compile errors on the updatePasswordInfo method.
This is the method:
def…

alberto adami
- 729
- 1
- 6
- 25
2
votes
0 answers
BSON to Play JSON support for Long values
I've started using the play-json/play-json-compat libraries with reactivemongo 0.20.11.
So I can use JSON Play reads/writes while importing the 'reactivemongo.play.json._' package and then easily fetch data from a JSONCollection instead of a…

sid802
- 315
- 2
- 18
2
votes
1 answer
Should I create recursive method for retry in mongodb transaction to avoid document level lock error?
I am using mongodb transaction. Sometimes it may happen that for concurrent transaction in same document data update the second transaction will create transient transaction error which will abort the second concurrent update.
In this case retry…

John
- 2,633
- 4
- 19
- 34
2
votes
0 answers
How do I resolve ReactiveMongo 20.3 console warning?
On updating from "org.reactivemongo" %% "play2-reactivemongo" % "0.16.6-play26" to "org.reactivemongo" %% "play2-reactivemongo" % "0.20.3-play27" I get the following warnings which I'm not sure how to handle.
package object json in package json is…

jesus g_force Harris
- 485
- 6
- 16
2
votes
1 answer
How to write documents to MongoDB using ReactiveMongo transactions?
I am trying to run this simple code, which insert a document to "reports" collection under transaction.
This is the code:
def runWithTransaction(): Future[Unit] = {
for {
dbWithSession <- db.db.startSession()
dbWithTx <-…

Ameen
- 137
- 3
2
votes
1 answer
Method find in ReactiveMongo is deprecated. Use 'find' with optional projection
I am working on a project which integrates play framework with
reactive mongo. I recently upgraded reactive mongo to 0.18.5 version.
After upgrading i get the warning:
method find in trait GenericCollection is deprecated (since 0.16.0): Use find…

Vaibhav Srivastava
- 29
- 1
- 12
2
votes
0 answers
Run into ChannelNotFound error loop after the MongoDB server keeps a high load for a short time
After the MongoDB server keeps a high load for a short time, the play-reactivemongo module runs into a ChannelNotFound error loop:
2017-10-09 13:16:17 +0800 [ERROR] from reactivemongo.api.Failover2 in ForkJoinPool-3-worker-1 -…

joymufeng
- 288
- 1
- 7
2
votes
1 answer
Type mismatch when upgrading to ReactiveMongo 0.12.RC3
I am currently upgrading to 0.12.RC3 in hope of fixing the following issue I am experiencing. After upgrading, I received a deprecation warning for the collect method.
So I moved from:
def find(query: JsObject = Json.obj())(implicit reader:…

John Doe
- 277
- 3
- 14
2
votes
1 answer
Scala Define a generic class that only accepts case classes
When defining a generic class in Scala how can I ensure that the type parameter 'A' must be a case class?
class TypedCollection[A](name: String){}
Context:
I'm trying to define a generic 'TypedCollection' wrapper class to interact a reactivemongo…

Oliver Rice
- 768
- 8
- 20
2
votes
2 answers
How to convert JSON String to a BSONDocument
I have the following function that uses the reactivemongo driver and actually does a good job writing to the database.
def writeDocument() = {
val document = BSONDocument(
"firstName" -> "Stephane",
"lastName" -> "Godbillon",
…

summerNight
- 1,446
- 3
- 25
- 52
2
votes
0 answers
ReactiveMongo reference annotations
I have some general questions about ReactiveMongo plugin. I have previously used Morphia with Play and we have now migrated to scala and I would like to clarify some things.
1) Is it a good practise to use @References annotations similar to…

glarkou
- 7,023
- 12
- 68
- 118
2
votes
0 answers
Reactive mongo Authorization issue
I am running mongd with Auth enabled
mongod --auth
I have a read write user on a DB.
db.system.users.find()
Logs -
{ "_id" : "products_development.user_rw", "user" : "user_rw", "db" : "products_development", "credentials" : { "MONGODB-CR" :…

Kiran Raj
- 187
- 1
- 9
1
vote
0 answers
How to convert BSONDocument to JsObject in reactiveMongo 1.0
I am working on upgrading legacy scala DAO layer code from reactivemongo 0.20 to 1.0. The old code return JsObject, compiler is asking for the implicit BSONDocumentReader[JsObject].
However, I can't find any way to define this val from the official…

code farmer
- 91
- 1
- 8
1
vote
0 answers
ReactiveMongo query to count documents
I have a problematic mongo query. Problematic because it takes 10-12seconds and that's is why I am looking for a different implementation.
The query is trying to perform a count of how many items are in the collection. I'm sure there is a better way…

lucek091
- 61
- 1
- 5
1
vote
1 answer
Working with ReactiveMongo (for play framework apps) in 2020
I'v set up and new project of playframework 2.8, and my dilemmas are:
1. which dependency should I use:
"org.reactivemongo" %% "reactivemongo" % "1.0"
OR
"org.reactivemongo" %% "play2-reactivemongo" // dont even think that there is 1.0 for play…

JohnBigs
- 2,691
- 3
- 31
- 61