Answer the question
In order to leave comments, you need to log in
Sampling with postgre by jsonb intersection?
I have a view with jsonb, I need to find the intersection of the data
request, it works, I'm trying to do the same in the code
select * from "ListView"
where("Relationship" @> '[{"Type": "Action", "RelationshipId": "3"}]');
filterParams.Append("Relationship", $"\"Relationship\" @> @Relationship", $"'[{{\"Type\": \"{Relationship.Type}\", \"RelationshipId\": \"{Relationship.Id}\"}}]'");
[ERROR] 42883: operator does not exist: jsonb @> text at Npgsql.NpgsqlConnector.<>c__DisplayClass161_0
Answer the question
In order to leave comments, you need to log in
it was necessary to remove the single '
because at startup the builder wraps itself
and add jsonb to the
values
filterParams.Append("Relationship", $"\"Relationship\" @> @Relationship::jsonb", $"[{{\"Type\": \"{Relationship.Type}\", \"RelationshipId\": \"{Relationship.Id}\"}}]");
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question