Asynchronous & Non-Blocking Scala Driver for MongoDB
Questions tagged [reactivemongo]
508 questions
0
votes
2 answers
ReactiveMongo Find One Document Error
With the following code bit, I'm trying to fetch a single document based on a user's email where email is part of the stored document:
def userByEmail(encryptedEmail: String): Future[Either[ServiceError, User]] = async {
println(s"finding a…

joesan
- 13,963
- 27
- 95
- 232
0
votes
1 answer
Convert Model Class to ReactiveMongo BSONDocument
I have a case class which is a model object in my application and goes like this:
case class MyModel(myTypeA: TypeA, str: String)
case class TypeA(intVal: Int, strVal: String)
I'm using MongoDB and the ReactiveMongo library for my persistence…

joesan
- 13,963
- 27
- 95
- 232
0
votes
1 answer
Reactivemongo leaking connections during Play hot-reload
I have a Scala-based Play app that uses ReactiveMongo. When in development mode and a hot-reload occurs, ReactiveMongo leaks connections. For example, here is a snippet of Mongo's log files; I added a line break in the logs to indicate each time a…

Dave Taubler
- 1,081
- 3
- 12
- 25
0
votes
0 answers
ReactiveMongo: Need to convert java.time.LocalDate to reactivemongo.bson.BSONDateTime
My requirement is to set BSONDateTime to specific data only. From java.util.Date i found exact data, but when trying to convert in BSONDateTime my output is wrong. Following is my code for convert:
val currentDate: LocalDate = LocalDate.now();
val…

Harmeet Singh Taara
- 6,483
- 20
- 73
- 126
0
votes
1 answer
Play ReactiveMongo: Need to create generic result class for RawCommand using ReactiveMongo
I want to create generic result models for RawCommand using reactive mongo with play framework. But i got an error. Following is my generic models case class structure.
case class DistinctRawCommandResult[T] (
val values: List[T],
val stats:…

Harmeet Singh Taara
- 6,483
- 20
- 73
- 126
0
votes
1 answer
RuntimeException on validation of JsonReaders - Scala - ReactiveMongo
I have a case classe to store my userOption that I insert into my User.
The structure of my user is as such:
{
"_id":ObjectId("55d54d05ece39a6cf774c3e4"),
"main":{
"providerId":"userpass",
"userId":"test1@email.com",
…

odroz
- 151
- 1
- 6
0
votes
1 answer
Play2 Scala models - merge objects
I'm using Play2+Scala+ReactiveMongo to build a web application. Since mongodb doesn't require all documents to have the same structure, I make a large use of case classes with Options as parameters to implement models. For example:
case class…

tano
- 836
- 1
- 10
- 25
0
votes
1 answer
ReactiveMongo: How to select more than one document from a collection randomly?
I've found this example... but it shows how to select one document from a collection randomly, while I need to select more than one document and as efficiently as possible.

j3d
- 9,492
- 22
- 88
- 172
0
votes
1 answer
Type mismatch issue
I'm working on play 2.3, I want to update a collection while insert to another collection. Below is the code which is throwing error.
def create(message : MessageThread) : Future[reactivemongo.core.commands.LastError] = {
…
0
votes
1 answer
Connect second enumerator to Concurrent.broadcast
I'm trying to inject Mongos capped collection enumerator into existing Concurrent.broadcast enumerator. Is it possible? Or is there a better way?
Main enumerator:
val (event, eventChannel) = Concurrent.broadcast[JsValue]
and my capped collection…

PsychoX
- 1,088
- 4
- 21
- 43
0
votes
1 answer
How to Implement the SQL Join Equivalent in MongoDB [ReactiveMongo]
Given the following collections:
// Users
{ "_id": ObjectId("1"), "username": "user1", "role": "developer" }
{ "_id": ObjectId("2"), "username": "user2", "role": "projectManager" }
{ "_id": ObjectId("3"), "username": "user3", "role": "testManager"…

j3d
- 9,492
- 22
- 88
- 172
0
votes
1 answer
Cannot resolve symbol in routes file with intellij 14 and play framework 2.4 reactivemongo
I'm using IntelliJ 14.1.4 and Play framework 2.4. I copied some code from this github project: https://github.com/JAVEO/play-reactivemongo-polymer to test out reactivemongo. Basically, I copied the Posts.scala to my controller folder. It's a…

yang
- 498
- 5
- 22
0
votes
0 answers
disable Reactive Mongo plugin in Play 2.3.x
Is there a way to disable the Reactive Mongo plugin on the command line in Play 2.3.x? Something like play.evolutions.enabled=false.
My use case is that I have certain servers that talk to Mongo only & some that talk to another DB only. I want the…

Foo L
- 10,977
- 8
- 40
- 52
0
votes
1 answer
"java.lang.RuntimeException: null" while querying with Reactive Mongo 0.11
I'm trying to query a collection with findAll with selector = {} on JsonCollection with Play 2.4.2 and Reactive Mongo 0.11.5.
Query fails in method foldM deep inside the play.api.libs.iteratee while calling method collect[List].
Last code that I…

Pavel Kudinov
- 405
- 2
- 8
0
votes
0 answers
ReactiveMongo connector hitting ConnectionNotInitialized exception
I've been working on a Spark Streaming application which interfaces with MongoDB via the reactivemongo connector. However, the Spark job is hitting the following exception
16:53:23.153 [ForkJoinPool-4-worker-5] ERROR reactivemongo.api.Failover2 -…

jithinpt
- 1,204
- 2
- 16
- 33