Hello,
I’m using the Squidex Client Library to query contents and would like to make use of the OData or Json filter functionality.
I have a schema with a Name and Id fields and would like to filter values of Id field using OR operator. In the GetAsync method of ContentClients, I’m passing ContentQuery object with Filter property value as below.
data/Id/iv eq '12345' or data/Id/iv eq '12345'
But it results in an error saying “The app name or schema name or entity doesn’t exist” with 400 status code.
So, I thought of trying the Json filter option and set the below value to the property JsonQuery of ContentQuery object. But that too resulted in the same error as above.
JsonQuery = new
{
filter = new
{
or = Ids.Take(10).Select(x => new
{
path = "data.Id.iv",
op = "eq",
value = $"{x}"
}).ToArray()
}
}
NOTE : Ids is just a List that holds all the values that I like to filter on.
Does the below stack trace tell you anything about what is going wrong ? Also, the error message, “The app, schema or entity does not exist.” is not helping either.
at Squidex.ClientLibrary.Utils.SquidexClientBase.<EnsureResponseIsValidAsync>d__12.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Squidex.ClientLibrary.Utils.SquidexClientBase.<RequestJsonAsync>d__10`1.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Program.<<Main>$>d__0.MoveNext() in C:\Users\narayanasamys\source\repos\SquidexUserDataCorrection\SquidexUserDataCorrection\Program.cs:line 45
I do have all the required permission. The query fails when I try with OR operator. May be one of the Id that I’m passing doesn’t exist and that results in 404 ? Not sure. I’m going to look into the logs and provide you the details.
Do you have a script or something like that? If you can, provide me a backup of your database and a sample to reproduce it. Then I can have a closer look.