2

We want to change our MongoDB driver overtime to MongoDB Scala Driver, but we using Salat and it reads and writes sealed classes and ADTs using "_typeHint" to the DB. The MongoDB Scala Driver reads and writes sealed classes and ADTs using "_t", What we want is a way to read and write "_typeHint" using MongoDB Scala Driver? We know we need a custom codec, but not sure how to implement it.

We want the ability to support both drivers until we remove Salat.

Thanks.

Hamada
  • 1,836
  • 3
  • 13
  • 27
Chester Cobus
  • 701
  • 4
  • 12

1 Answers1

1

This appears to be described here. See "annotation convention" and "bson discriminator".

D. SM
  • 13,584
  • 3
  • 12
  • 21