Asynchronous & Non-Blocking Scala Driver for MongoDB
Questions tagged [reactivemongo]
508 questions
0
votes
1 answer
Can connect to MongoDB in Heroku through Mongo shell but not application
I have setup a scala play reactive-mongo application in heroku. Mongo is provided by mlab in heroku. Having a bit of an issue connecting to mongo through the app, connecting through the shell with the same credentials works fine. I am using scala…

user1584120
- 1,169
- 2
- 23
- 44
0
votes
1 answer
Perform 2 operations to update on ReactiveMongo
I am testing the next 2 query on mongo shell an it works,
But now, I need to perform the same query in reactivemongo
Someone can give me a suggestion for how to make the query in reactivemongo
doc = db.offer.find({"_id":…

Sanx
- 223
- 1
- 6
- 17
0
votes
1 answer
Reading/Writing None values as null with ReactiveMongo
We are in the process of migrating an existing REST service from Spring/Java to Spray using ReactiveMongo. One of the requirements for the migration (the first phase of it anyway), is that all inputs and outputs must match the current system. The…

TheIcemanCometh
- 1,055
- 2
- 17
- 31
0
votes
1 answer
Get an error message while tring to rewrite ReactiveMongo + BSON to JSON in Play Framework
I tried to use Json library to replace Bson library.
This is the original code which works.
case class City(name: String, population: Int)
object City {
implicit val reader = Macros.reader[City]
}
@Singleton
class CityController @Inject()(val…

Roger Chien
- 344
- 3
- 13
0
votes
0 answers
Error gridfs with reactiveMongo 0.11.9 scala and playframework
I'm trying to follow this example https://github.com/sgodbillon/reactivemongo-demo-app and then implement this in my project.
but I found many difficulties, because I'm using "org.reactivemongo" %% "play2-reactivemongo" % "0.11.9" not the same…

Rajeun
- 721
- 2
- 12
- 37
0
votes
1 answer
error getting files from gridfs
I'm trying to display images and files from gridfs. So I started with the save function and it's working well:
import javax.inject.Inject
import org.joda.time.DateTime
import scala.concurrent.Future
import play.api.Logger
import…

Rajeun
- 721
- 2
- 12
- 37
0
votes
1 answer
No Json serializer as JsObject found for type play.api.libs.json.JsObject. Try to implement an implicit OWrites or OFormat for this type
I am newbie to mongodb and also to reactive mongo and I'm trying to integrate this example to my project https://github.com/sgodbillon/reactivemongo-demo-app
Firstly I would like to work only with class article but when I integrate the model and…

Rajeun
- 721
- 2
- 12
- 37
0
votes
1 answer
Basic Create-from-Json Method Walkthrough
I'm new to play, scala, and reactivemongo and was wondering if someone could explain to me the following code in easy terms to understand.
def createFromJson = Action.async(parse.json) { request =>
import play.api.libs.json.Reads._
val transformer:…

Jeff
- 211
- 3
- 11
0
votes
0 answers
Insert document with ReactiveMongo does not use BSONWriter or Reader
I have the following class:
case class DeviceRegistration(deviceData: DeviceData,
pin: String,
created: DateTime) {}
Type DeviceData is defined simply as 4 string fields.
I've been trying…

redwulf
- 1,317
- 3
- 13
- 35
0
votes
1 answer
Cannot invoke the action, eventually got an error: java.lang.IllegalArgumentException: Only JsObjects can be stored in Play framework?
I am new to Reactivemongo database(2.6), as I am trying to upload/insert json object(which is of key/value pairs, I am sending it to store in database after clicking of Submit button from my UI ) from my localsystem to store in Mongodb using Play…

Dhana
- 711
- 3
- 14
- 40
0
votes
1 answer
Drop database with reactive Mongo
I need to drop a Mongo database using ReactiveMongo. Since ReactiveMongo does not provide specialiaed API for that I decided to use "runCommand" function.
This is how a database can be deleted in Mongo shell:
> db.runCommand("dropDatabase")
{…

Ivan Mushketyk
- 8,107
- 7
- 50
- 67
0
votes
1 answer
Reactive Mongo Extensions: How to use $push with $each using query DSL in reactive mongo extensions
I want to push list of documents in mongodb document array field. In mongodb we can use $push with $each operator, but how we can using in reactive mongo extensions. example as below:
This is my doucment
{
"_id" :…

Harmeet Singh Taara
- 6,483
- 20
- 73
- 126
0
votes
1 answer
Get the return value of reactivemongo findAndUpdate function
I call the findAndUpdate function on a mongo collection to increase a counter, and I want to get the value of the counter for further use.Here is my code:
collection.findAndUpdate(
BSONDocument("name" -> "counter"),
BSONDocument("$inc" ->…

Wen-Hsin Hsieh
- 79
- 1
- 6
0
votes
1 answer
How to check if MongoDB is up and running using reactivemongo
I am trying to write a helper function that will allow my dashboard to check if MongoDB is running on not. Based on the result, it could warn admins on the visual dashboard. I read through the reactive mongo docs here and I have the following…

summerNight
- 1,446
- 3
- 25
- 52
0
votes
1 answer
How should I use JSONFindAndModifyCommand?
I have no idea how I should use play-reactivemongo's JSONFindAndModifyCommand.
I need to make an upsert query by some field. So I can first remove any existing entry and then insert. But Google says that FindAndModify command has upsert: Boolean…

iTollu
- 999
- 13
- 20