0
簡單的要求:從記錄獲取一個記錄集
a1 = where(MyModel, [x], is_nil(x.some_foreign_id)) |> Repo.one()
例外:
** (exit) an exception was raised:
** (Ecto.MultipleResultsError) expected at most one result but got 6 in query:
是的,有是一些記錄,這是很正常的,但我的本意是拿第一一。爲什麼是異常和如何解決它?