0
votes
0answers
8 views

Bad Symbolic reference to reactivemongo.api.collections.GenericHandlers encountered in class file 'JSONGenericHandlers.class'

I'm having my apis in play 2.3 with reactive mongo. Recently, i tried to cleaned the project and during the process, some things got updated. Later, when i tried to run or compile that, i'm getting ...
0
votes
1answer
28 views

Find all documents where the array elements matches some conditions in reactivemongo

In my MongoDB database I've a collection named "recommendation.users" in which i store all the User data. A document of my collection has the following form: { "_id" : ...
0
votes
0answers
17 views

How to search data by location using the Salat?

case class Venue(@Key("_id") id: Int, location: Tupe2[Double, Double], name: String) object VenueDAO extends SalatDAO[Venue, Int](collection = MongoConnection()("ec")("venue")) VenueDAO.find(?) ...
0
votes
1answer
27 views

Finding the maxing value of an attribute in mongoDB using casbah

I am a newbie to casbah and mongodb. I am trying to write a scala code to find max value of of a column. For example: {"_id"=1,value = "a"} {"_id"=2,value = "b"} {"_id"=3,value = "c"} ...
0
votes
0answers
43 views

how to update a value in nested json using scala?

I am using scala and mongo DB- I have following json structure- { "items": [{ "itemName": "name", "users": [ "A", "B" ] },{ "itemName": ...
0
votes
0answers
28 views

How to update value of single key in mongoDB using scala?

I have following DB structure in mongoDB- { "groups": [ { "groupName": "groupname", "query": "query string" }, { "groupName": "Oracle", "query": "query ...
0
votes
1answer
10 views

Error while including casbah dependencies

I am facing problem in getting started with casabah to integrate scala and mongoDb. I am using Spring Tool Suite(STS) and imported the following jar files : spring-data-mongodb-1.6.0.RELEASE.jar ...
1
vote
1answer
21 views

MongoDBObject not being added to inside of an rrd foreach loop casbah scala apache spark

Ok guru's, i've got a problem that doesnt make much sense to me. I am stuck trying to save an object to mongodb that looks like such (roughly) {data:[baseball:[{timestamp ...
0
votes
1answer
11 views

Mapping in Play with Internal MongoDb Fields

Environment: PlayFramework 2.3, ReactiveMongo, ReactiveMongo-Extensions, MongoDb, Scala What is a good way to map incoming Json to MongoDb collection where there are a bunch of internal only elements ...
0
votes
1answer
55 views

Get a String from a JSon request

i'm writing a Play 2.3.2 application in Scala. I'm writing a Statistic controller that queries my mongodb database for obtain some informations. Now i'm trying to implement a method that returns all ...
0
votes
0answers
24 views

Play-scala ArrayIndexOutOfBoundsException intermitent errors

Hey guys I wrote an application using play(2.2.4) and scala(2.10.3) the application uses reactive mongo to connect to mongoDB, once doing load testing we started to notice a weird error, we checked ...
0
votes
1answer
38 views

Wait that an Asynchronous call in a Scala application terminate

i'm writing a Play 2.3.2 application using reactivemongo driver (with Scala). I write a method that search the most used tag in my db and update the max and tagFound variables. def max = Action { ...
0
votes
1answer
37 views

Error on a count query on mongodb using reactivemongo

i'm writing a play 2.3.2 application. In my application i use a MongoDB database. I've a recommendation.tags and recommendation.request collections. They has the following JSON format: 1) ...
0
votes
0answers
11 views

how to aggregate multiple collections in salat mongodb

I have three collections like WindowsCollection,EsxCollection and LinuxCollection in these all three collections documents i have cpuUtilization,memoryUtilization,hostID keys. Now i have to find top ...
0
votes
0answers
30 views

Scala and Mongodb : how to execute dbdump in scala?

how to execute dbdump in scala? so far this is all I have but not working : val mongoConn = MongoConnection( "db" ) mongoConn.mongoDump("path") mongoConn.underlying.close() Looking forward for the ...
0
votes
1answer
11 views

Casbah multidimensional Array - Retrieve from DB

I have a case class with a 2-dimensional array stored in a MongoDB, because Salat does not support Arrays I'm trying to write my own converters. case class Matrix(id: String, matr: Array[Array[Int]]) ...
0
votes
0answers
33 views

Connection with credentials to a non localhost mongodb using Play / scala / casbah /salat

Tried many ways and googled accross. In my opinion it should work just by setting the configuration file like this: mongodb.default.host="ahost" mongodb.default.port=aport ...
0
votes
1answer
19 views

How to read back a datetime as UTC in MongoDB / Casbah?

I'm storing times in UTC at a MongoDB server. When reading them back, using: import org.joda.time.DateTime ... val time_utc: DateTime = dbo.get("time_utc").asInstanceOf[DateTime] I get times ...
0
votes
1answer
24 views

Best way to use Scala MongoClient in Play 2.0

I have just started using Play 2.0 with Scala and Casbah for connecting to MongoDB. I have been able to connect to my MongoDB instance but what I am looking for is a way to be able to access the ...
0
votes
2answers
37 views

Understanding the Future[Option[T]] in reactiveMongo

i'm writing a play 2.3 application in Scala. I use a mongoDB database and the ReactiveMongo driver. The method that i call to read/write/update the dates in the db return a Future[Option[T]]. My ...
0
votes
1answer
29 views

Error on overriding method reads in trait Reads

I'm writing a play application 2.3 (using Scala). I'm using the secure social module (master). Now i'v created my User class: class LoginUser( providerId: String, userId: String, ...
0
votes
0answers
36 views

How do we convert Mongo DB Document as a String to Scala MongoDBObject?

Given a MongoDBOOject as a String, which may have been exported from the database using the command line, like this: { "_id" : ObjectId("5411a12e3004ec44d0f9596d"), "createdDate" : ...
1
vote
1answer
43 views

Why multiple mongodb connecions with Casbah?

I have to manage multiple databases connection to MongoDb, using casbah scala client. I have an approximation that works but open hundreds of connections. I want to save a Map[String, MongoDB] that ...
0
votes
1answer
49 views

How to update Mongodb structure from string to object?

I need to update image string to object, my old code is : Scala : case class Property ( id: ObjectId = new ObjectId, image: String, description: String ) Mongodb : { "_id": ...
0
votes
1answer
33 views

Need json deserializer for 3rd-party case class

I'm implementing a SecureSocial service for my Scala Play! application. I'm using the ReactiveMongoPlugin to access the MongoDB store. Here is the code... lazy val users: JSONCollection = ...
0
votes
1answer
30 views

Specifying MongoDBObject as content of $set

I need to construct an update query like this: { $set: {"yow": 1, "man": 2}, $setOnInsert: {"a": 3}, } I just don't know how to do it using Cashbah. The thing is the value for the $set, I got ...
0
votes
1answer
67 views

ReactiveMongo & Play: How to compare two DateTime instances

I use Play-ReactiveMongo to interact with MongoDB... and I'm wondering how to compare two dates considering that I don't use BSON in my application. Let me provide you with an example: def ...
0
votes
0answers
39 views

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( ...
0
votes
1answer
25 views

How to create builder for $set operation in casbah?

I can't create adequate builder for $set operation in casbah For example this function work properly, if both username and lang are defined def updateUser(userId: String, username: Option[String], ...
1
vote
1answer
469 views

How do I resolve a MongoDB timeout error when connecting via the Scala Play! framework?

I am connecting to MongoDB while using the Scala Play! framework. I end up getting this timeout error: ! @6j672dke5 - Internal server error, for (GET) [/accounts] -> play.api.Application$$anon$1: ...
0
votes
1answer
34 views

How to use Cashbah MongoDB connections?

Note: I realise there is a similar question on SO but it talks about an old version of Casbah, plus, the behaviour explained in the answer is not what I see! I was under the impression that Casbah's ...
1
vote
0answers
54 views

Form submiting with Play/Scala and MongoDB

I am currently writing my first application with scala (2.11), Playframework (2.2.3) and MongoDB (with Salat). Since I dont really know any of them too well I've got a bit of a beginner problem: I ...
0
votes
0answers
40 views

Array query in Scala and ReactiveMongo?

I have a MongoDB collection whose documents look like this: { "name" : "fabio", "items" : [ { "id" : "1", "word" : "xxxx" }, { "id" ...
1
vote
1answer
28 views

How to map Json type value in mongodb with Morphia

As below, how to write the mapping for liknurl which is also a json type value in Play Framework? @Entity(value = "appstore", noClassnameStored = true) class Ad { @Id var id = new ObjectId() ...
1
vote
1answer
84 views

Can't resolve casbah as a sbt dependency

I'm getting the following error upon compile: [error] (*:update) sbt.ResolveException: unresolved dependency: org.mongodb#casbah_2.11;2.7.4-SNAPSHOT: not found With this build.sbt file: name := ...
0
votes
1answer
138 views

Using MongoDBObject Query Builder with Salat

I am attempting to provide an API to search a MongoDB collection on various criteria, including a full-text search. Since this is a Scala project (in Play FWIW), I am using Salat, an abstraction ...
0
votes
0answers
82 views

Reactivemongo map serializing

I use Play Framework 2.2.2, reactivemongo 0.10.2. I try to update mongo document with Map[String, Any] def db: reactivemongo.api.DB = ReactiveMongoPlugin.db val collection = ...
0
votes
1answer
45 views

How to get specific fields in the List

I have this code to get mongodb data using scala : var user = User.findOneById(userId) var userGroups = user.get.groups.filter(_.status == UserStatus.ACTIVE) Now in userGroups List I only need ...
0
votes
0answers
73 views

Akka/Scala sending JSON to Backbone.js

I use Scala/Akka (Cashbah) to connect to remote MongoDB and successfully retrieve all data (collection.find()) whenever my REST endpoint is reached. (Something like url/get-data). But my whole web app ...
0
votes
0answers
52 views

Casbah MongoDB Error

I have the Casbah MongoDB driver that I use in my Web Application and when I tried to connect to the Database which is when the Casbah driver API's are called, I face a strange error: ...
1
vote
1answer
49 views

scala salat objectid is changing after inserting into database

I've a problem with Salat library in scala - I've got a case class Item: case class Item(_id: ObjectId = new ObjectId, var name: String, var active: Boolean) extends WithId { override def id: ...
0
votes
1answer
35 views

Problems using Nothing bottom type while trying to create generic zeros for parametrized monoids

Here's my code. It permits to create typesafe MongoDB queries using Casbah trait TypesafeQuery[ObjectType, BuildType] { def build: BuildType } trait TypesafeMongoQuery[ObjectType] extends ...
2
votes
3answers
93 views

Scala case class generated field value

I have an existing Scala application and it uses case classes which are then persisted in MongoDB. I need to introduce a new field to a case class but the value of it is derived from existing field. ...
0
votes
0answers
30 views

Load an object with object id

I am trying to load a MongoDB object on a PlayFramework application using Reactive Mongo driver. This is the code: val query = Json.obj("_id" -> Json.obj("$oid" -> objectId)) val ...
0
votes
0answers
43 views

How to mock a generic SalatDAO method using Scalamock?

This: val users = MongoClient()("test")("users") class UserDAO extends SalatDAO[User, ObjectId](users) val query = MongoDBObject("username" -> "somename") val m = mock[UserDAO] ...
0
votes
0answers
26 views

Issue with ReactiveMongo 'serve' method

I have a strange issue with ReactiveMongo plugin(0.10.2), used to store and serve videos using MongoDB GridFS. I could store the video files from latest andriod(.mp4) and iphone(.mov) in reactive ...
0
votes
1answer
63 views

Mapping Scala class to Scalding or MongoDB

I am new to both Scala and NoSQL databases. I would like to know is if there exist ORM tools that will map my Scala objects to a NoSQL database, as with RDBMS solutions?
2
votes
2answers
97 views

Monad transformer in Scala for comprehension to handle Option and collect error messages

I've been looking at a lot of Scala monad transformer examples and haven't been able to figure out how to do what I think is probably something straightforward. I want to write a for comprehension ...
0
votes
2answers
58 views

ReactiveMongo BSONDouble vs BSONLong

I have a large csv file which I converted to UTF8 via iconv and then loaded into Mongo. I'm getting lots of errors trying to query the data using ReactiveMongo / Scala. It seems that some records put ...
0
votes
0answers
34 views

Mongodump fails with result 134

I am trying to dump mongo database on my production server(mongodump version 2.0.4) and jenkins using Runtime.getRuntime().exec("mongodump ") and I am getting Process failed. Result code: 134 What ...