score:2
Accepted answer
this is how you do it for play 2.1 (documentation)
val dbo = mongodbobject("id" -> "0001", "name" -> "kevin", "age" -> "100")
val json: jsvalue = json.parse(dbo.tostring)
Source: stackoverflow.com
Related Query
- Convert MongoDBObject to JsValue
- How to convert String into JsValue in Play Framework
- How to convert a scala object with list to a MongoDBObject via Casbah
- How to convert java.time.LocalDate to JSValue in Play?
- Scala Play 2 - convert JsValue to model Object
- Convert a JsValue to a model via Reads[T] which consists of a list of tuples
- How to convert JsValue to a Model Class with Scala in Play framework?
- efficient way to transform a playframework JsValue to a MongoDBObject
- How to Convert MongoDBObject to JsonString
- How can I convert JsValue to Array[Int] in Scala?
- How to convert SearchResponse to JsValue
- Convert JsValue to a model via Reads[T] which consits parts of list of arbitrary tuples and parts of known objects
- Is it possible in Play 2.1 to convert a JsValue to a case class instance if you only know the name of the case class at the runtime?
- How to convert rdd object to dataframe in spark
- How to convert a scala.List to a java.util.List?
- How to convert an Int to a String of a given length with leading zeros to align?
- Idiomatic way to convert an InputStream to a String in Scala
- How to convert a java.util.List to a Scala list
- How can I convert immutable.Map to mutable.Map in Scala?
- Convert List of tuple to map (and deal with duplicate key ?)
- Convert a Scala list to a tuple?
- In Scala, is there an easy way to convert a case class into a tuple?
- How can I convert a Java Iterable to a Scala Iterable?
- How to convert Row of a Scala DataFrame into case class most efficiently?
- How do I convert csv file to rdd
- Convert Java Map to Scala Map
- convert a byte array to string
- Convert list in Scala to a formatted string
- How to convert String to date time in Scala?
- How to convert a Seq[A] to a Map[Int, A] using a value of A as the key in the map?
More Query from same tag
- Shorter and better way to find difference between timestamps
- Scalaz Lens Composition
- How to use the values of TaskKey and SettingKey to define setting?
- Scala Sorting with Another Json's Key
- Scala: How to require that a type have parameterless constructors
- What is the best way to define type safe optional methods in Scala?
- Scala and Play! framework form error
- Error reading image from scala playn
- Scala: How to take any generic sequence as input to this method
- Best way to use type classes with list parametrized with some base class, abstract class or trait
- Scala functional programming operator :::
- How to get spark-submit hive context running properly with tez and yarn?
- Using stat.bloomFilter in Spark 2.0.0 to filter another dataframe
- Scala, collapsing Option of an Option
- Inheritance (class hierarchy) of Equals and Ordered[T] (type parameter erasure)
- Inheritance with Scala 'object'
- Will the var members in case class affect case class's equality?
- Apache spark - loading data from elasticsearch is too slow
- 'ensime generate' is not a valid sbt command
- Scala options pattern matching alternatives?
- How to get IntelliJ to recognize imports in Scala script?
- Scala - sbt, main.scala and custom package
- scala interactive shell documentation support copy paste
- Using Scala kernel with Spark
- Referring to abstract type members in class constructors in Scala
- How to refer to instance methods in documentation?
- Reorder Key-Value Pairs using map() in Spark Scala
- Scala: reflect class with implicit param
- HOMap implementation example
- why = is optional in def in Scala