Questions tagged [salat]

Salat is a bi-directional Scala case class serialization library that leverages MongoDB's `DBObject` (which uses BSON underneath) as its target format.

The Salat project focuses on speed and simplicity of serializing case classes to and from target formats.

Salat is not a fully-fledged ORM and does not attempt to match the flexibility, compability or functionality of an ORM that would let you define relationships between classes, provide a query language, or serialize/deserialize every collection type known to Java or Scala.

109 questions
0
votes
1 answer

Scala Salat deserialization error with @key

I have a case class that looks like this: import com.novus.salat.annotations.raw.Key import org.bson.types.ObjectId case class Users( _id: ObjectId, email: String, password: String, …
invis
  • 1,078
  • 2
  • 14
  • 26
0
votes
1 answer

Installing Play Salat in Intellij IDEA project

I'm writing a simple application on Scala using Play Framework and I'd like to use Play Salat in my application. I'm using Intellij IDEA Ultimate as the IDE and I've generated the Play project as it's said in the IDEA documentation. However, I'm…
Vlad Stryapko
  • 1,035
  • 11
  • 29
0
votes
1 answer

Scala case class not return data

I used mongoDB and scala in my project using salat library and my model contains as : case class ApplicationGroupModel( @Key("_id") id: ObjectId, devicesData: List[ApplicationDevicesData] ) case class ApplicationDevicesData( hostId:…
Neo-coder
  • 7,715
  • 4
  • 33
  • 52
0
votes
2 answers

SalatDAO deserialization of typed class with list

I have the following case classes: case class Network(val name : String, val mac : String) case class Field[T](var value : T, var source : String = "") case class Device(var _id : ObjectId = new ObjectId, var device_type :…
Aliza
  • 734
  • 1
  • 10
  • 25
0
votes
3 answers

How to log queries?

I am using salat library in play!framework to query data from MongoDB. I have troubles with some queries. So, I want to log (using logback in play!) to see how the actual queries that are generated by salat.
mmdc
  • 1,677
  • 3
  • 20
  • 32
0
votes
1 answer

How to search data stored in tuples using Salat?

case class Venue(@Key("_id") id: Int, location: Tuple2[Double, Double], name: String) object VenueDAO extends SalatDAO[Venue, Int](collection = MongoConnection()("ec")("venue")) VenueDAO.find(?) //return…
DimParf
  • 285
  • 2
  • 13
0
votes
0 answers

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 10 records from all three collections and get…
Pradip Karad
  • 1,377
  • 2
  • 9
  • 8
0
votes
2 answers

Salat serialisation error

I'm currently having issues with Salat. Hope you guys can help me! Here's the case class that is driving me crazy: object UserDAO extends SalatDAO[User, ObjectId]( collection = DB("users") //Returns the "users" MongoCollection ) case class User( …
Matteo Pacini
  • 21,796
  • 7
  • 67
  • 74
0
votes
1 answer

How do I submit a form for a model that contains a list of other models with Salat & Play framework?

I have a model. It contains a list of another model: case class Account( _id: ObjectId = new ObjectId, name: String, campaigns: List[Campaign] ) case class Campaign( _id: ObjectId = new ObjectId, name: String ) I have a form and action…
Di Zou
  • 4,469
  • 13
  • 59
  • 88
0
votes
1 answer

Base Class properties not written to MongoDB

Using Play 2 / Scala , casbah and Salat abstract class BaseQuestion(val data:String,val responses:List[StudentResponse] = Nil){ val key:String = UUID.randomUUID().toString } case class Question(override val data:String, val questionType:String =…
smk
  • 5,340
  • 5
  • 27
  • 41
0
votes
1 answer

Scala Failed to deserialize java.util.date format

I have a scala class for a mongodb collection using Salat. I tried to deserialize json string to object in my test case. However, it throws an exception about the format of date type. It runs fine in getting the object using Salat DAO. But when I…
angelokh
  • 9,426
  • 9
  • 69
  • 139
0
votes
1 answer

salat - proper way to append to a list of inner case classes without deserializing the outer object?

I have models like this: @Salat class Base case class Outer(@Key("_id") id:String = "outer", inners:List[Inner] = Nil) extends Base case class Inner(id:String = "inner") extends Base object Outer extends SalatDAO[Outer,…
grinch
  • 804
  • 1
  • 9
  • 17
0
votes
1 answer

Salat MongoDB argument type mismatch

I have a case class that I map to the Salat library using the SalatDAO extentions. In this case class, one of the parameters is an Enum type. When I run it to fetch the data from the database, I get the following…
joesan
  • 13,963
  • 27
  • 95
  • 232
0
votes
3 answers

Casbah Scala Runtime Error

I have a Play framework based webapp which has the following defined in its build.sbt file: .... version := "1.0-SNAPSHOT" resolvers += "Sonatype Snapshots" at "http://oss.sonatype.org/content/repositories/snapshots/" resolvers += "Sonatype…
joesan
  • 13,963
  • 27
  • 95
  • 232
0
votes
1 answer

Representing Complex JSON using Salat and MongoDB

I have a case class composition that looks like below: case class TypeA(id: Int, text: String, typeBList: List[TypeB]) case class TypeB(id: Int, text: String) I use MongoDB for persisting the data and the resulting JSON document looks like: TypeA…
joesan
  • 13,963
  • 27
  • 95
  • 232