How to find key of hash in jsonb in Rails?

Viewed 1097

Example Model Home, column: animals. Inside animals jsonb like this:

dogs: {
  dog1: { attributes...},
  dog2: { attributes...},
  ...
}

Question
How can I find dog1 only by the key("dog1")

1 Answers
Related