Skip to content

Instantly share code, notes, and snippets.

@alaz
Created October 1, 2010 12:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alaz/606155 to your computer and use it in GitHub Desktop.
Save alaz/606155 to your computer and use it in GitHub Desktop.
class OptionalEmbeddedField[V](override val mongoFieldName: String, val g: T => Option[V], val p: Option[(T,Option[V]) => Unit])
extends MongoScalar[V] with EmbeddedContent[V] with FieldModifyOp[V] with Optional[V] {
self: MongoField[V] with ObjectIn[V, QueryType] =>
override val rep = parent.Represented.byOption(g, p)
override def canEqual(other: Any): Boolean = other.isInstanceOf[OptionalEmbeddedField[_]]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment