Questions tagged [reactivemongo]

Asynchronous & Non-Blocking Scala Driver for MongoDB

508 questions
0
votes
3 answers

A ReactiveMongo pattern to return the created mongodb document in one RESTful request

Environment: Play! 2.2.3, ReactiveMongo 0.10.0-SNAPSHOT Suppose I have a page with a list of documents (let's say "projects") and a button that pops up a modal dialogue with fields to be filled in. Upon pressing the OK button the page sends a…
Rajish
  • 6,755
  • 4
  • 34
  • 51
0
votes
1 answer

reactivemongo - merging two BSONDocuments

I am looking for the most efficient and easy way to merge two BSON Documents. In case of collisions I have already handlers, for example if both documents include Integer, I will sum that, if a string also, if array then will add elements of the…
Alex K
  • 854
  • 9
  • 16
0
votes
1 answer

Transform _id to id with JSON format macro

I use reactivemongo in my Play application. My models use the property id and not _id. How can I automatically transform the object ID(_id), so that it will be mapped to the id property of my models. Currently I write the format by hand: implicit…
akkie
  • 2,523
  • 1
  • 20
  • 34
0
votes
1 answer

Odd behaviour reading an entire collection using Reactivemongo in Play Framework 2

I have the following code: def all: String = { val query = BSONDocument("name" -> BSONDocument("$ne" -> "allDocs")) val cursor = carsCollection.find(query).cursor[BSONDocument] Logger.debug("Before cursor") …
G A
  • 571
  • 3
  • 6
  • 18
-1
votes
1 answer

ReactiveMongo GridFS error saving file from disk

I have an application that uses gridFS to store some images for things. Im using the gridFSBodyParser and controllers work. Now I need to seed some data from disk for a test for a particular edge case, for which I cannot use the controller because…
kot
  • 65
  • 1
  • 7
-1
votes
1 answer

How to fix compatibility warning of Akka with ReactiveMongo 0.20.3

I have upgraded to reactive mongo 0.17.1 to 0.20.3. and after that I facing these warnings. [WARN] [03/17/2020 12:20:43.782] [main] [ManifestInfo(akka://reactivemongo)] Detected possible incompatible versions on the classpath. Please note that…
v_d123
  • 29
  • 6
-1
votes
1 answer

How can I see how many documents were written & handle errors correctly?

From the documentation I can see that I should be able to use WriteResult.ok, WriteResult.code and WriteResult.n in order to understand errors and the number of updated documents but this isn't working. Here is a sample of what I'm doing (using…
-1
votes
1 answer

Play Framework Dependency Injection error

This is my code: package controllers import javax.inject.Inject import scala.concurrent.Future import play.api.Logger import play.api.mvc.{ Action, Controller } import play.api.libs.concurrent.Execution.Implicits.defaultContext import…
user8213320
-1
votes
1 answer

object BSONDocumentFormat in trait BSONFormats is deprecated: 0.11.9

I have a following function that takes in an input JSON and validates it against a given JSON-Schema using the "com.eclipsesource" %% "play-json-schema-validator" % "0.6.2". This whole setup is working great until I have started getting warnings…
summerNight
  • 1,446
  • 3
  • 25
  • 52
-1
votes
1 answer

Testing reactivemongo with scalatest raise an exception

I am trying to test some functionality in the app. I have other tests (with scalatest for reactivemongo) and are working, but with this I am getting this exception [info] - should Persist and find a token * FAILED * [info] The future returned…
agusgambina
  • 6,229
  • 14
  • 54
  • 94
-1
votes
1 answer

method cursor in trait GenericQueryBuilder is deprecated

I'm working with "org.reactivemongo" %% "play2-reactivemongo" % "0.11.7.play24" and when i compile my proyect, show me the next errors: [error] /home/hector/enova/play-silhouette-reactivemongo-seed-master/app/controllers/CourseController.scala:90:…
Sanx
  • 223
  • 1
  • 6
  • 17
-1
votes
1 answer

Play! Framework - return multiple list to template

I have 3 classes and I wanna return 3 lists to template which use in Form my db is MongoDB def addCourse = Action.async {implicit request => val teacherCollection = db.collection[BSONCollection]("Teacher") val courseColl =…
roohix
  • 11
  • 4
-1
votes
2 answers

Resquest MongoDB with scala

I want to do an application in Scala, with a MongoDB database. I found some tutorials to use it with ReactiveMongo, I wrote my classes, but I want to test it and I don't understand how to do a simple request; to add a user for example, or find…
Azuken
  • 477
  • 1
  • 9
  • 26
1 2 3
33
34