case class JsTimestamp(value: Timestamp) extends JsValue with Ordered[JsTimestamp] with Product with Serializable
An SQL TIMESTAMP value. It adds the ability to hold the SQL TIMESTAMP fractional seconds value, by allowing the specification of fractional seconds to a precision of nanoseconds. Support the JDBC escape syntax for timestamp values.
The precision of a Timestamp object is calculated to be either:
- 19 , which is the number of characters in yyyy-mm-dd hh:mm:ss
- 20 + s , which is the number of characters in the yyyy-mm-dd hh:mm:ss.[fff...] and s represents the scale of the given Timestamp, its fractional seconds precision.
- Alphabetic
- By Inheritance
- JsTimestamp
- Serializable
- Product
- Equals
- Ordered
- Comparable
- JsValue
- Dynamic
- AnyRef
- Any
- by json2Date
- by json2Timestamp
- by orderingToOrdered
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def +(other: String): String
- Implicit
- This member is added by an implicit conversion from JsTimestamp toany2stringadd[JsTimestamp] performed by method any2stringadd in scala.Predef.
- Definition Classes
- any2stringadd
- def ->[B](y: B): (JsTimestamp, B)
- Implicit
- This member is added by an implicit conversion from JsTimestamp toArrowAssoc[JsTimestamp] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @inline()
- def <(that: JsTimestamp): Boolean
- Definition Classes
- Ordered
- def <=(that: JsTimestamp): Boolean
- Definition Classes
- Ordered
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def >(that: JsTimestamp): Boolean
- Definition Classes
- Ordered
- def >=(that: JsTimestamp): Boolean
- Definition Classes
- Ordered
- def apply(range: Range): JsArray
- Definition Classes
- JsValue
- def apply(start: Int, end: Int, step: Int): JsArray
- Definition Classes
- JsValue
- def apply(start: Int, end: Int): JsArray
- Definition Classes
- JsValue
- def apply(index: Int): JsValue
- Definition Classes
- JsValue
- def apply(key: String): JsValue
- Definition Classes
- JsValue
- def applyDynamic(key: String)(index: Int): JsValue
- Definition Classes
- JsValue
- def asBoolean: Boolean
- Definition Classes
- JsValue
- def asDate: LocalDate
- Definition Classes
- JsTimestamp → JsValue
- def asDateTime: LocalDateTime
- Definition Classes
- JsTimestamp → JsValue
- def asDecimal: BigDecimal
- Definition Classes
- JsValue
- def asDouble: Double
- Definition Classes
- JsTimestamp → JsValue
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def asInt: Int
- Definition Classes
- JsValue
- def asLong: Long
- Definition Classes
- JsTimestamp → JsValue
- def asTime: LocalTime
- Definition Classes
- JsTimestamp → JsValue
- def asTimestamp: Timestamp
- Definition Classes
- JsValue
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def compactPrint: String
- Definition Classes
- JsValue
- def compare(that: JsTimestamp): Int
- Definition Classes
- JsTimestamp → Ordered
- def compareTo(that: JsTimestamp): Int
- Definition Classes
- Ordered → Comparable
- def ensuring(cond: (JsTimestamp) => Boolean, msg: => Any): JsTimestamp
- Implicit
- This member is added by an implicit conversion from JsTimestamp toEnsuring[JsTimestamp] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: (JsTimestamp) => Boolean): JsTimestamp
- Implicit
- This member is added by an implicit conversion from JsTimestamp toEnsuring[JsTimestamp] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: Boolean, msg: => Any): JsTimestamp
- Implicit
- This member is added by an implicit conversion from JsTimestamp toEnsuring[JsTimestamp] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: Boolean): JsTimestamp
- Implicit
- This member is added by an implicit conversion from JsTimestamp toEnsuring[JsTimestamp] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(o: Any): Boolean
- Definition Classes
- JsTimestamp → Equals → AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def get(key: String): Option[JsValue]
- Definition Classes
- JsValue
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getNanos(): Int
- Implicit
- This member is added by an implicit conversion from JsTimestamp toTimestamp performed by method json2Timestamp in smile.json.
- Definition Classes
- Timestamp
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def prettyPrint: String
- Definition Classes
- JsValue
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- def remove(index: Int): JsValue
- Definition Classes
- JsValue
- def remove(key: String): Option[JsValue]
- Definition Classes
- JsValue
- def selectDynamic(key: String): JsValue
- Definition Classes
- JsValue
- def setNanos(arg0: Int): Unit
- Implicit
- This member is added by an implicit conversion from JsTimestamp toTimestamp performed by method json2Timestamp in smile.json.
- Definition Classes
- Timestamp
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toLocalDateTime(): LocalDateTime
- Implicit
- This member is added by an implicit conversion from JsTimestamp toTimestamp performed by method json2Timestamp in smile.json.
- Definition Classes
- Timestamp
- def toString(): String
- Definition Classes
- JsTimestamp → JsValue → AnyRef → Any
- def update(index: Int, value: JsValue): JsValue
- Definition Classes
- JsValue
- def update(key: String, value: JsValue): JsValue
- Definition Classes
- JsValue
- def updateDynamic(index: Int)(value: JsValue): JsValue
- Definition Classes
- JsValue
- def updateDynamic(key: String)(value: JsValue): JsValue
- Definition Classes
- JsValue
- val value: Timestamp
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
Shadowed Implicit Value Members
- def <(that: JsTimestamp): Boolean
- Implicit
- This member is added by an implicit conversion from JsTimestamp toOrdered[JsTimestamp] performed by method orderingToOrdered in scala.math.Ordered.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(jsTimestamp: Ordered[JsTimestamp]).<(that)
- Definition Classes
- Ordered
- def <=(that: JsTimestamp): Boolean
- Implicit
- This member is added by an implicit conversion from JsTimestamp toOrdered[JsTimestamp] performed by method orderingToOrdered in scala.math.Ordered.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(jsTimestamp: Ordered[JsTimestamp]).<=(that)
- Definition Classes
- Ordered
- def >(that: JsTimestamp): Boolean
- Implicit
- This member is added by an implicit conversion from JsTimestamp toOrdered[JsTimestamp] performed by method orderingToOrdered in scala.math.Ordered.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(jsTimestamp: Ordered[JsTimestamp]).>(that)
- Definition Classes
- Ordered
- def >=(that: JsTimestamp): Boolean
- Implicit
- This member is added by an implicit conversion from JsTimestamp toOrdered[JsTimestamp] performed by method orderingToOrdered in scala.math.Ordered.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(jsTimestamp: Ordered[JsTimestamp]).>=(that)
- Definition Classes
- Ordered
- def after(arg0: Date): Boolean
- Implicit
- This member is added by an implicit conversion from JsTimestamp toDate performed by method json2Date in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Date).after(arg0)
- Definition Classes
- Date
- def after(arg0: Timestamp): Boolean
- Implicit
- This member is added by an implicit conversion from JsTimestamp toTimestamp performed by method json2Timestamp in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Timestamp).after(arg0)
- Definition Classes
- Timestamp
- def after(arg0: Date): Boolean
- Implicit
- This member is added by an implicit conversion from JsTimestamp toTimestamp performed by method json2Timestamp in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Timestamp).after(arg0)
- Definition Classes
- Date
- def before(arg0: Date): Boolean
- Implicit
- This member is added by an implicit conversion from JsTimestamp toDate performed by method json2Date in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Date).before(arg0)
- Definition Classes
- Date
- def before(arg0: Timestamp): Boolean
- Implicit
- This member is added by an implicit conversion from JsTimestamp toTimestamp performed by method json2Timestamp in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Timestamp).before(arg0)
- Definition Classes
- Timestamp
- def before(arg0: Date): Boolean
- Implicit
- This member is added by an implicit conversion from JsTimestamp toTimestamp performed by method json2Timestamp in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Timestamp).before(arg0)
- Definition Classes
- Date
- def clone(): AnyRef
- Implicit
- This member is added by an implicit conversion from JsTimestamp toDate performed by method json2Date in smile.json.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(jsTimestamp: Date).clone()
- Definition Classes
- Date → AnyRef
- def clone(): AnyRef
- Implicit
- This member is added by an implicit conversion from JsTimestamp toTimestamp performed by method json2Timestamp in smile.json.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(jsTimestamp: Timestamp).clone()
- Definition Classes
- Date → AnyRef
- def compare(that: JsTimestamp): Int
- Implicit
- This member is added by an implicit conversion from JsTimestamp toOrdered[JsTimestamp] performed by method orderingToOrdered in scala.math.Ordered.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(jsTimestamp: Ordered[JsTimestamp]).compare(that)
- Definition Classes
- Ordered
- def compareTo(arg0: Date): Int
- Implicit
- This member is added by an implicit conversion from JsTimestamp toDate performed by method json2Date in smile.json.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(jsTimestamp: Date).compareTo(arg0)
- Definition Classes
- Date → Comparable
- def compareTo(arg0: Date): Int
- Implicit
- This member is added by an implicit conversion from JsTimestamp toTimestamp performed by method json2Timestamp in smile.json.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(jsTimestamp: Timestamp).compareTo(arg0)
- Definition Classes
- Timestamp → Date → Comparable
- def compareTo(arg0: Timestamp): Int
- Implicit
- This member is added by an implicit conversion from JsTimestamp toTimestamp performed by method json2Timestamp in smile.json.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(jsTimestamp: Timestamp).compareTo(arg0)
- Definition Classes
- Timestamp
- def compareTo(that: JsTimestamp): Int
- Implicit
- This member is added by an implicit conversion from JsTimestamp toOrdered[JsTimestamp] performed by method orderingToOrdered in scala.math.Ordered.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(jsTimestamp: Ordered[JsTimestamp]).compareTo(that)
- Definition Classes
- Ordered → Comparable
- def equals(arg0: AnyRef): Boolean
- Implicit
- This member is added by an implicit conversion from JsTimestamp toDate performed by method json2Date in smile.json.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(jsTimestamp: Date).equals(arg0)
- Definition Classes
- Date → AnyRef → Any
- def equals(arg0: AnyRef): Boolean
- Implicit
- This member is added by an implicit conversion from JsTimestamp toTimestamp performed by method json2Timestamp in smile.json.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(jsTimestamp: Timestamp).equals(arg0)
- Definition Classes
- Timestamp → Date → AnyRef → Any
- def equals(arg0: Timestamp): Boolean
- Implicit
- This member is added by an implicit conversion from JsTimestamp toTimestamp performed by method json2Timestamp in smile.json.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(jsTimestamp: Timestamp).equals(arg0)
- Definition Classes
- Timestamp
- def getTime(): Long
- Implicit
- This member is added by an implicit conversion from JsTimestamp toDate performed by method json2Date in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Date).getTime()
- Definition Classes
- Date
- def getTime(): Long
- Implicit
- This member is added by an implicit conversion from JsTimestamp toTimestamp performed by method json2Timestamp in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Timestamp).getTime()
- Definition Classes
- Timestamp → Date
- def hashCode(): Int
- Implicit
- This member is added by an implicit conversion from JsTimestamp toDate performed by method json2Date in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Date).hashCode()
- Definition Classes
- Date → AnyRef → Any
- def hashCode(): Int
- Implicit
- This member is added by an implicit conversion from JsTimestamp toTimestamp performed by method json2Timestamp in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Timestamp).hashCode()
- Definition Classes
- Timestamp → Date → AnyRef → Any
- def setTime(arg0: Long): Unit
- Implicit
- This member is added by an implicit conversion from JsTimestamp toDate performed by method json2Date in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Date).setTime(arg0)
- Definition Classes
- Date
- def setTime(arg0: Long): Unit
- Implicit
- This member is added by an implicit conversion from JsTimestamp toTimestamp performed by method json2Timestamp in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Timestamp).setTime(arg0)
- Definition Classes
- Timestamp → Date
- def toInstant(): Instant
- Implicit
- This member is added by an implicit conversion from JsTimestamp toDate performed by method json2Date in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Date).toInstant()
- Definition Classes
- Date
- def toInstant(): Instant
- Implicit
- This member is added by an implicit conversion from JsTimestamp toTimestamp performed by method json2Timestamp in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Timestamp).toInstant()
- Definition Classes
- Timestamp → Date
- def toString(): String
- Implicit
- This member is added by an implicit conversion from JsTimestamp toDate performed by method json2Date in smile.json.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(jsTimestamp: Date).toString()
- Definition Classes
- Date → AnyRef → Any
- def toString(): String
- Implicit
- This member is added by an implicit conversion from JsTimestamp toTimestamp performed by method json2Timestamp in smile.json.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(jsTimestamp: Timestamp).toString()
- Definition Classes
- Timestamp → Date → AnyRef → Any
Deprecated Value Members
- def formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from JsTimestamp toStringFormat[JsTimestamp] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @deprecated @inline()
- Deprecated
(Since version 2.12.16) Use
formatString.format(value)
instead ofvalue.formatted(formatString)
, or use thef""
string interpolator. In Java 15 and later,formatted
resolves to the new method in String which has reversed parameters.
- def getDate(): Int
- Implicit
- This member is added by an implicit conversion from JsTimestamp toDate performed by method json2Date in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Date).getDate()
- Definition Classes
- Date
- Annotations
- @Deprecated
- Deprecated
- def getDate(): Int
- Implicit
- This member is added by an implicit conversion from JsTimestamp toTimestamp performed by method json2Timestamp in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Timestamp).getDate()
- Definition Classes
- Date
- Annotations
- @Deprecated
- Deprecated
- def getDay(): Int
- Implicit
- This member is added by an implicit conversion from JsTimestamp toDate performed by method json2Date in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Date).getDay()
- Definition Classes
- Date
- Annotations
- @Deprecated
- Deprecated
- def getDay(): Int
- Implicit
- This member is added by an implicit conversion from JsTimestamp toTimestamp performed by method json2Timestamp in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Timestamp).getDay()
- Definition Classes
- Date
- Annotations
- @Deprecated
- Deprecated
- def getHours(): Int
- Implicit
- This member is added by an implicit conversion from JsTimestamp toDate performed by method json2Date in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Date).getHours()
- Definition Classes
- Date
- Annotations
- @Deprecated
- Deprecated
- def getHours(): Int
- Implicit
- This member is added by an implicit conversion from JsTimestamp toTimestamp performed by method json2Timestamp in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Timestamp).getHours()
- Definition Classes
- Date
- Annotations
- @Deprecated
- Deprecated
- def getMinutes(): Int
- Implicit
- This member is added by an implicit conversion from JsTimestamp toDate performed by method json2Date in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Date).getMinutes()
- Definition Classes
- Date
- Annotations
- @Deprecated
- Deprecated
- def getMinutes(): Int
- Implicit
- This member is added by an implicit conversion from JsTimestamp toTimestamp performed by method json2Timestamp in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Timestamp).getMinutes()
- Definition Classes
- Date
- Annotations
- @Deprecated
- Deprecated
- def getMonth(): Int
- Implicit
- This member is added by an implicit conversion from JsTimestamp toDate performed by method json2Date in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Date).getMonth()
- Definition Classes
- Date
- Annotations
- @Deprecated
- Deprecated
- def getMonth(): Int
- Implicit
- This member is added by an implicit conversion from JsTimestamp toTimestamp performed by method json2Timestamp in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Timestamp).getMonth()
- Definition Classes
- Date
- Annotations
- @Deprecated
- Deprecated
- def getSeconds(): Int
- Implicit
- This member is added by an implicit conversion from JsTimestamp toDate performed by method json2Date in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Date).getSeconds()
- Definition Classes
- Date
- Annotations
- @Deprecated
- Deprecated
- def getSeconds(): Int
- Implicit
- This member is added by an implicit conversion from JsTimestamp toTimestamp performed by method json2Timestamp in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Timestamp).getSeconds()
- Definition Classes
- Date
- Annotations
- @Deprecated
- Deprecated
- def getTimezoneOffset(): Int
- Implicit
- This member is added by an implicit conversion from JsTimestamp toDate performed by method json2Date in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Date).getTimezoneOffset()
- Definition Classes
- Date
- Annotations
- @Deprecated
- Deprecated
- def getTimezoneOffset(): Int
- Implicit
- This member is added by an implicit conversion from JsTimestamp toTimestamp performed by method json2Timestamp in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Timestamp).getTimezoneOffset()
- Definition Classes
- Date
- Annotations
- @Deprecated
- Deprecated
- def getYear(): Int
- Implicit
- This member is added by an implicit conversion from JsTimestamp toDate performed by method json2Date in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Date).getYear()
- Definition Classes
- Date
- Annotations
- @Deprecated
- Deprecated
- def getYear(): Int
- Implicit
- This member is added by an implicit conversion from JsTimestamp toTimestamp performed by method json2Timestamp in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Timestamp).getYear()
- Definition Classes
- Date
- Annotations
- @Deprecated
- Deprecated
- def setDate(arg0: Int): Unit
- Implicit
- This member is added by an implicit conversion from JsTimestamp toDate performed by method json2Date in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Date).setDate(arg0)
- Definition Classes
- Date
- Annotations
- @Deprecated
- Deprecated
- def setDate(arg0: Int): Unit
- Implicit
- This member is added by an implicit conversion from JsTimestamp toTimestamp performed by method json2Timestamp in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Timestamp).setDate(arg0)
- Definition Classes
- Date
- Annotations
- @Deprecated
- Deprecated
- def setHours(arg0: Int): Unit
- Implicit
- This member is added by an implicit conversion from JsTimestamp toDate performed by method json2Date in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Date).setHours(arg0)
- Definition Classes
- Date
- Annotations
- @Deprecated
- Deprecated
- def setHours(arg0: Int): Unit
- Implicit
- This member is added by an implicit conversion from JsTimestamp toTimestamp performed by method json2Timestamp in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Timestamp).setHours(arg0)
- Definition Classes
- Date
- Annotations
- @Deprecated
- Deprecated
- def setMinutes(arg0: Int): Unit
- Implicit
- This member is added by an implicit conversion from JsTimestamp toDate performed by method json2Date in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Date).setMinutes(arg0)
- Definition Classes
- Date
- Annotations
- @Deprecated
- Deprecated
- def setMinutes(arg0: Int): Unit
- Implicit
- This member is added by an implicit conversion from JsTimestamp toTimestamp performed by method json2Timestamp in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Timestamp).setMinutes(arg0)
- Definition Classes
- Date
- Annotations
- @Deprecated
- Deprecated
- def setMonth(arg0: Int): Unit
- Implicit
- This member is added by an implicit conversion from JsTimestamp toDate performed by method json2Date in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Date).setMonth(arg0)
- Definition Classes
- Date
- Annotations
- @Deprecated
- Deprecated
- def setMonth(arg0: Int): Unit
- Implicit
- This member is added by an implicit conversion from JsTimestamp toTimestamp performed by method json2Timestamp in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Timestamp).setMonth(arg0)
- Definition Classes
- Date
- Annotations
- @Deprecated
- Deprecated
- def setSeconds(arg0: Int): Unit
- Implicit
- This member is added by an implicit conversion from JsTimestamp toDate performed by method json2Date in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Date).setSeconds(arg0)
- Definition Classes
- Date
- Annotations
- @Deprecated
- Deprecated
- def setSeconds(arg0: Int): Unit
- Implicit
- This member is added by an implicit conversion from JsTimestamp toTimestamp performed by method json2Timestamp in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Timestamp).setSeconds(arg0)
- Definition Classes
- Date
- Annotations
- @Deprecated
- Deprecated
- def setYear(arg0: Int): Unit
- Implicit
- This member is added by an implicit conversion from JsTimestamp toDate performed by method json2Date in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Date).setYear(arg0)
- Definition Classes
- Date
- Annotations
- @Deprecated
- Deprecated
- def setYear(arg0: Int): Unit
- Implicit
- This member is added by an implicit conversion from JsTimestamp toTimestamp performed by method json2Timestamp in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Timestamp).setYear(arg0)
- Definition Classes
- Date
- Annotations
- @Deprecated
- Deprecated
- def toGMTString(): String
- Implicit
- This member is added by an implicit conversion from JsTimestamp toDate performed by method json2Date in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Date).toGMTString()
- Definition Classes
- Date
- Annotations
- @Deprecated
- Deprecated
- def toGMTString(): String
- Implicit
- This member is added by an implicit conversion from JsTimestamp toTimestamp performed by method json2Timestamp in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Timestamp).toGMTString()
- Definition Classes
- Date
- Annotations
- @Deprecated
- Deprecated
- def toLocaleString(): String
- Implicit
- This member is added by an implicit conversion from JsTimestamp toDate performed by method json2Date in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Date).toLocaleString()
- Definition Classes
- Date
- Annotations
- @Deprecated
- Deprecated
- def toLocaleString(): String
- Implicit
- This member is added by an implicit conversion from JsTimestamp toTimestamp performed by method json2Timestamp in smile.json.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(jsTimestamp: Timestamp).toLocaleString()
- Definition Classes
- Date
- Annotations
- @Deprecated
- Deprecated
- def →[B](y: B): (JsTimestamp, B)
- Implicit
- This member is added by an implicit conversion from JsTimestamp toArrowAssoc[JsTimestamp] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use
->
instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.
JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages,
JSON has only types of string, number, boolean, object, array, and null. This library includes additional types such as date, int, long, double, counter, binary, UUID, ObjectId (as in BSON), etc.
It is very easy to parse a JSON object:
The interpolator
json
parse a string toJsObject
. To parse an array, use the interpolatorjsan
toJsArray
. It is also okay to embed variable references directly in processed string literals.If the string is not a JSON object but any other valid JSON expression, one may use parseJson method to convert the string to a
JsValue
."1".parseJson
The json interpolator can only be applied to string literals. If you want to parse a string variable, the
parseJson
method can always be employed. If you know the string contains a JSON object, you may also use the methodparseJsObject
.To serialize a JSON value (of type JsValue) in compact mode, you can just use
toString
. To pretty print, use the methodprettyPrint
.With a
JsObject
orJsArray
, you can refer to the individual elements with a variation of array syntax, like this:Note that we follow Scala's array access convention by
()
rather than[]
in JavaScript.Besides, you can use the dot notation to access its fields/elements just like in JavaScript:
doc.store.bicycle.color doc.store.book(0).author
It is worth noting that we didn't define the type/schema of the document while Scala is a strong type language. In other words, we have both the type safe features of strong type language and the flexibility of dynamic language in this JSON library.
If you try to access a non-exist field,
JsUndefined
is returned.Although there are already several nice JSON libraries for Scala, the JSON objects are immutable by design, which is a natural choice for a functional language. For database, however, data mutation is necessary. Therefore,
JsObject
andJsArray
are mutable data structures. You can set/add a field just like in JavaScript:json.store.bicycle.color = "green"
To delete a field from
JsObject
, use remove method:It is same as setting it
JsUndefined
:doc.store.book(0).price = `JsUndefined`
To delete an element from
JsArray
, the remove method will effectively remove it from the array. However, setting an element to undefined doesn't reduce the array size.It is also possible to append an element or another array to
JsArray
:Common iterative operations such as
foreach
,map
,reduce
can be applied toJsArray
too.doc.store.book.asInstanceOf[JsArray].foreach { book => println(book.price) }
Because Scala is a static language, it is impossible to know
doc.store.book
is an array at compile time. So it is typed as genericJsValue
, which is the parent type of specific JSON data types. Therefore, we useasInstanceOf[JsArray]
to convert it toJsArray
in order to useforeach
.