Questions tagged [reactivemongo]

Asynchronous & Non-Blocking Scala Driver for MongoDB

508 questions
2
votes
0 answers

ReactiveMongo Play module: Gridfs files serving

What is the most canonical way to write serve files with ReactiveMongo version 0.11.2 on play framework ? In old version I can do it with the following controller function def img(id: String) = Action.async { val file =…
Oleg
  • 3,080
  • 3
  • 40
  • 51
2
votes
1 answer

Play2-reactivemongo. Scala. Update Option field on None does not occur without errors

I have class MyClass with Option field (e.g. f:Option[String]). I update it by the value (e.g. Some("abc")) and it warks. If I change it on another value (e.g. Some("xyz")) it works too. But I cannot update it on None now. There is no error. Simply…
Alex
  • 87
  • 2
  • 11
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
2
votes
1 answer

reactivemongo BSON writer / reader with arbitrary JSON branch (also using spray)

I am building REST API using spray. All is working well except this case class: case class User(name: String, places: List[String], data: List[JsObject]) The key issue here is the data parameter. It contains a json object with arbitrary number of…
IUnknown
  • 2,596
  • 4
  • 35
  • 52
2
votes
0 answers

ReactiveMongo: Should I disconnect?

Do I have to close some instances after the completion of work with the base using the ReactiveMongo driver? When I do a lot of inserts and then I call driver.close(), many operations can not be completed with dead letters akka messages. Can I be…
Tolsi
  • 656
  • 9
  • 20
2
votes
1 answer

How to Query DateTime with Reactive Mongo?

This is what I currently have: BSONDocument("updated" -> BSONDocument("$gte" -> BSONDateTime(DateTime.now.plusDays(-2).getMillis), "$lt" -> BSONDateTime(DateTime.now.plusDays(-1).getMillis))) However when I use this I don't get anything…
zunior
  • 841
  • 2
  • 13
  • 24
2
votes
1 answer

Why does reactivemongo's collection.save() do a get()?

Sometimes I read a piece of code written by experts that raises a big red flag because it clearly is concerned about things that I know nothing about - and probably should. In this case, here's the implementation of reactivemongo's…
Ed Staub
  • 15,480
  • 3
  • 61
  • 91
2
votes
2 answers

Understanding Future in Scala

i'm writing a Play 2.3.2 application in Scala. I use the reactivemongo driver to access to a mongodb database. I've write that query the db to obtain the most used tag in the database. This method is an Action.async and is implemented as the…
alberto adami
  • 729
  • 1
  • 6
  • 25
2
votes
0 answers

What's is the meaning of this error 'command failed because the 'ok' field is missing or equals 0' when executing RawCommand in ReactiveMongo?

I am trying do execute the following command using RawCommand in ReactiveMongo: val commandDoc = BSONDocument( "update" -> "users", "updates" -> BSONArray( BSONDocument("q" -> BSONDocument("_id" ->…
Lucas Batistussi
  • 2,283
  • 3
  • 27
  • 35
2
votes
1 answer

Reactivemongo: How to handle an exception that happens Inside Iteratee.fold

it seems like reacitvemongo enumerators are not handling exceptions correctly. The code below consumes an enumerator ( returned by reactivemongo driver) to create a list, the problem here is that when there is an exception inside fold function the…
faissalb
  • 1,739
  • 1
  • 12
  • 14
2
votes
0 answers

Plugin performance issues with tailable collections and enumerators

I have created a simple Play plugin that creates user notifications. This is done by using a tailable, capable collection. lazy val unprocessed: Future[Enumerator[Event]] = { for { coll <- collection } yield coll.find(Json.obj("processed"…
DanielKhan
  • 1,190
  • 1
  • 9
  • 18
2
votes
1 answer

Reactivemongo QueryOpts.batchSizeN not work

I use play Reactivemongo plugin and Reactivemongo work together. def list(ps: Int = pageSize, page: Int = 1, sortBy: String = "_id", order: Int = 1, filterKey: String = "", filter: String = "") = Action.async { implicit request => val builder =…
jmuok
  • 340
  • 1
  • 11
2
votes
1 answer

Implicit value not found for BSON Writer in reactivemongo

I've a very simple case class which is part of a bigger case class. case class PublisherStatus(status: String) case class Publisher(id: Option[BSONObjectID], name: String, status: PublisherStatus, keywords: List[String], updatedAt:…
Soumya Simanta
  • 11,523
  • 24
  • 106
  • 161
2
votes
2 answers

Json Coast to Coast Play framework : Serializing Joda DateTime

Hi all I am new to play framework, if someone knows of a better approach then mentioned below please let me know. So I have a model and Reads/Writes/Format for it case class Schedule (startDate: DateTime, endDate: DateTime) object…
svirdi
  • 23
  • 2
2
votes
0 answers

serve files directly from GridFS with reactivemongo

I am using Play Framework 2.2.1 and Scala 2.10. I want to use reactivemongo to directly read files from gridFS so i can open it with a URL in browser e.g. http://www.example.com/playgridfs/filename How can i achieve that?
vaj oja
  • 1,151
  • 2
  • 16
  • 47