Asynchronous & Non-Blocking Scala Driver for MongoDB
Questions tagged [reactivemongo]
508 questions
2
votes
1 answer
How to use where operator in ReactiveMongo?
I am trying to use where operator in reactiveMongo to implement Full Text Search for Numeric and Text field using same API for both. But I am unable to get the correct syntax for doing it in reactive mongo.
I have followed mongoDocument…

Rajbala Chauhan
- 23
- 4
2
votes
2 answers
Scala ReactiveMongo example. Missed operations or implicits
I'm trying to use reactivemongo getstarted to investigate how to use it. I use:
scala 2.13.0
"org.reactivemongo" %% "reactivemongo" % "0.18.6"
Is for me I've done as it was required following documentation. But compilation issues appeared near…

Sergii
- 7,044
- 14
- 58
- 116
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
2 answers
Compatible Scala driver for Amazon DocumentDB
Do you know a Scala driver to MongoDB, which is also compatible to Amazon DocumentDB? In theory they all should be compatible, I am interested what works in practice. In particular, I plan to use reactivemongo.

Mikhail Golubtsov
- 6,285
- 3
- 29
- 36
2
votes
0 answers
Unable to find documents
I have a code like this:
def getItems(): Future[List[Item]] =
collection.find(BSONDocument.empty).cursor[Item]().
collect[List](-1, Cursor.FailOnError[List[Item]]())
But it is not getting all the items in the collection. When I look in…

Mojo
- 1,152
- 1
- 8
- 16
2
votes
1 answer
Query ReactiveMongo by a nested field
I have an object in a collection:
{ "id" : "123", "option" : { "key" : "one" , "value" : "1" }}
I can find the object like this:
collection.find(BSONDocument("option" -> BSONDocument("key" -> "one", "value" -> "1")))
However, what I need is to be…

ClassNotFoundException
- 409
- 5
- 15
2
votes
1 answer
BSONCollection.findAndRemove() cannot be called using flatmap
ReactiveMongo collection type provides method findAndRemove which can used to delete one document from a collection based on criteria in query. It returns a Future describing result of delete operation. Calling flatMap() on Future of this Future…

Xolve
- 22,298
- 21
- 77
- 125
2
votes
1 answer
Problems executing reactivemongo aggregation framework query getting a DefaultJSONCommandError
I'm using reactivemongo with play framework. I used to have a query which uses the aggregation framework and it worked as expected. Since updated to version 0.13.0 I get errors executing the query.
The class looks like this:
class Foo(
id:…

schub
- 912
- 1
- 8
- 26
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
Why a Thread.sleep or closing the connection is required after waiting for a remove call to complete?
I'm again seeking you to share your wisdom with me, the scala padawan!
I'm playing with reactive mongo in scala and while I was writting a test using scalatest, I faced the following issue.
First the code:
"delete" when {
"passing an existent id"…

Jeep87c
- 1,050
- 16
- 36
2
votes
1 answer
How to query in reactive mongo for like query for BigDecimal
I am using ReactiveMongo, I want to create a query that performs like query with numbers (BigDecimal) in MongoDB. For eg: whole number like 4321.3456 should be matched by 4321.34.
The following 2 queries work on MongoShell to achieve this:
…

khanal sir
- 103
- 1
- 9
2
votes
1 answer
How to terminate Akka actor system from a main method?
I've this application using Akka Streams and ReactiveMongo. There are no user defined actors. The application is launched from a main method.
Problem is the JVM continues to run forever after the main method has completed. This is what I'm doing…

Abhijit Sarkar
- 21,927
- 20
- 110
- 219
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
0 answers
object play is not a member of package reactivemongo
import play.modules.reactivemongo.json._
import play.modules.reactivemongo.json.collection._
import play.modules.reactivemongo.{
MongoController, ReactiveMongoApi, ReactiveMongoComponents
}
import reactivemongo.play.json._,…

tree em
- 20,379
- 30
- 92
- 130
2
votes
0 answers
Is this a parallel fold operation?
Definition of fold from Play! API is
as the folding function takes two different types A , E does this mean this operation is not run in parallel ?
As according to Fold and foldLeft method difference the type signature of fold (from Scala API) :…

blue-sky
- 51,962
- 152
- 427
- 752