reactivemongo.api.bson.Macros.Annotations
Specify a key different from field name in your case class. Convenient to use when you'd like to leverage mongo's _id index but don't want to actually use _id in your code.
_id
import reactivemongo.api.bson.Macros.Annotations.Key case class Website(@Key("_id") url: String)
Generated handler will map the url field in your code to _id field in BSON
url
the desired key to use in BSON
Specify a key different from field name in your case class. Convenient to use when you'd like to leverage mongo's
_idindex but don't want to actually use_idin your code.Generated handler will map the
urlfield in your code to_idfield in BSON