Closed joseadrianoemmanuel1999 closed 9 months ago
Hm. Seems like something is not being translated into the query correctly... it should be using the operators like specified here. (Notes for implementing a fix)
Off the top of my head, I wonder if ?tags=cs.{example, new}
is being sent incorrectly as ?tags=cs.{"example", "new"}
.
Could you try the In
operator instead and see if that works?
Thanks to respond me, Yes i try use operator In and nothing is working.
I'm able to duplicate, but I'm not sure what the issue is with the CONTAINS
operator. The request is being formed according to their documentation. I'm going to open an issue on the postgrest repo and see if they have an issue.
It looks like the functionality you're looking for is available using the IN
operator though.
The following test case works (relative to the PostgrestTests
part of the repo) as expected:
[TestMethod("filters: cs (list)")]
public async Task TestContainsFilterList()
{
var client = new Client(BaseUrl);
var filteredResponse = await client.Table<User>()
.Filter(x => x.Username!, Operator.In, new List<string> { "dragarcia", "acupofjose" })
.Get();
filteredResponse.Models.ForEach(x => Assert.IsTrue(x.Username is "dragarcia" or "acupofjose"));
}
@joseadrianoemmanuel1999 the answer given the issue:
The contains operator @> does not work for text types. It's used for arrays, json(b) and others. Are you trying to query all the users with username that belong to a list of candidates? If so you can use like(any).
So please use the IN
or LIKE
operator!
It's worked but it's sad other command fails, But thanks for help
Bug report
"code":"42883"
Describe the bug
I am trying to use this command in my project :
When i try use have this is error:
System information