Home > Blockchain >  Phoenix/Ecto - query for match in array of objects
Phoenix/Ecto - query for match in array of objects

Time:11-16

(Ecto.Query.CompileError) any(l.signers) is not a valid query expression.

(from l in Listing, where: "[email protected]" == any(l.signers))
    |> Repo.all()

CodePudding user response:

Ecto.Query.API.in/2 is supposed to be used to cover ANY selector.

where: mail_addr in l.signers

It is assumed that l.signers is an enumerable.

CodePudding user response:

select id,address,owners from listings where '[email protected]' = ANY(signers);

This qurty is work in postgresql.

  • Related