I could use some help figuring out why I'm getting this error:
could not find implicit value for evidence parameter of type com.foursquare.rogue.BSONType[org.joda.time.DateTime]
I have a MongoRecord that looks like this(roughly, edited to remove lots of non-relevant fields):
class Invitation extends MongoRecord[Invitation] with ObjectIdKey[Invitation] with IndexedRecord[Invitation] {
def meta: MongoMetaRecord[Invitation] = Invitation
object notification extends BsonRecordListField(this, NotificationBson)
object users extends BsonRecordListField(this, UserBson)
object createdOn extends JodaTimeWithFixesField(this)
object changedOn extends JodaTimeWithFixesField(this)
}
class UserBson extends BsonRecord[UserBson] {
def meta: BsonMetaRecord[UserBson] = UserBson
object _id extends ObjectIdField(this)
object reminderLimitReached extends BooleanField(this)
object nextReminderOn extends JodaTimeWithFixesField(this)
}
My query on these objects looks like this:
implicit val jodaDateTimeIsFlattened = new com.foursquare.rogue.Rogue.Flattened[org.joda.time.DateTime, org.joda.time.DateTime]
val now = DateTime.now
val invitations = Invitation.where(
_.notification.subfield(_.notifyStatus) eqs "notified").and(
_.notification.subfield(_.reminderLimit) gt 0).and(
_.users.subfield(_.completed) eqs false).and(
_.users.subfield(_.reminderLimitReached) eqs false).and(
_.users.subfield(_.nextReminderOn) lt now).and(
_.createOn lt now.minusDays(2).withTimeAtStartOfDay ).fetch.headOption
And I get this error:
InvitationReminderCommand.scala:36: could not find implicit value for evidence parameter of type com.foursquare.rogue.BSONType[org.joda.time.DateTime]
[error] _.users.subfield(_.nextReminderOn) lt now).and(
Which I'm certain is related to something I've done wrong when trying to make a specialized JodaTimeField, where I've overridden some json related methods:
class JodaTimeWithFixesField[OwnerType <: Record[OwnerType]](rec: OwnerType) extends JodaTimeField(rec) {
def dateFormat = JodaHelpers.dateTimeFormatter
override def asJValue: JValue = valueBox.map(v => JString(dateFormat.print(v))) openOr (JNothing: JValue)
override def asJs = valueBox.map(v => Str(dateFormat.print(v))) openOr JsNull
}
Thanks in advance for any help
-David