2

I'm using slick-pg with circe-json and I'm a bit stuck. I wonder is it possible to modify not the whole JSON, but only the value of a field? I can update JSON like this:

    db.run {
      questQuery.filter(_.json.+>>("name") === name.bind)
        .map(_.json)
        .update(newQuestJson)
    } 

But is there a way to update only one field? Something like this:

db.run {
      questQuery.filter(_.json.+>>("name") === questName.bind)
        .map(_.json.+>>(field))
        .update(newValue)
    }
bguiz
  • 27,371
  • 47
  • 154
  • 243
Akechik
  • 21
  • 1

0 Answers0