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
_id
index but don't want to actually use_id
in your code.Generated handler will map the
url
field in your code to_id
field in BSON