io.github.mbannour.fields

Members list

Type members

Classlikes

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Supertypes
class Object
trait Matchable
class Any
object MongoPath

Macro-powered extractor for case-class field paths that map to MongoDB document keys.

Macro-powered extractor for case-class field paths that map to MongoDB document keys.

Core ideas:

  • Accepts a selector lambda like _.address.zipCode and returns a dot-separated path (e.g. "address.zip").
  • Honors @BsonProperty on constructor parameters and uses the overridden name when present.
  • Supports a transparent hop over Option via the .? syntax imported from MongoPath.syntax.

Usage: import io.github.mbannour.fields.MongoPath import io.github.mbannour.fields.MongoPath.syntax.?

case class Address(street: String, @BsonProperty("zip") zipCode: Int) case class User(address: Option[Address])

MongoPath.ofUser // "address" MongoPath.ofUser // "address.zip"

Notes:

  • The .? method is never executed at runtime; it only helps the lambda typecheck and be recognized by the macro.
  • If the macro cannot detect a valid case-class field selection chain, it will abort compilation with an error.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
MongoPath.type