mongodb - ReactiveMongo 0.9: Joda Datetime Implicit Conversion for Macros.handler -


i have case class joda datetime field:

case domainpositiondata(domain: string, position: int, change: option[int], date:datetime) 

trying use macro generate reader&writer:

implicit val domposformat = macros.handler[domainpositiondata] 

i got:

implicit org.joda.time.datetime 'value date' not found 

but haven't found info how implement own implicit convertor.

looking @ source code existing handlers, try create implicit conversion (not tested):

import org.joda.time.datetime  implicit object bsondatetimehandler extends bsonhandler[bsondatetime, datetime] {   def read(time: bsondatetime) = new datetime(time.value)   def write(jdtime: datetime) = bsondatetime(jdtime.getmillis) } 

Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -