Help with wixData.query

Result from below mentioned code does not carry the data from DB.

let result = await wixData.query("ClientRolesAccess").eq("clientId", currentClientId).contains("roleName", desig).find();

Even though I’ve data in the DB, I’m not getting any result from this query. When I tried to debug, I found the result coming as follow:

"{"items":[],"length":0,"totalCount":0,"query":{"invalidArguments":[],"filterTree":{"$and":[{"clientId":"6beaddb6-54ce-4489-972a-c1c341f02c07"},{"roleName":{"$contains":"Junior"}}]},"provider":{},"collectionName":"ClientRolesAccess","limitNumber":50,"skipNumber":0,"included":[]}}"

It mentions something like (“query”:{“invalidArguments”) but I’ve no clue what is invalid in my query, I’ve double check all the arguments populating properly, as follow:

currentClientId = b4456331-3321-4aad-9852-5c7906395f19
desig = Junior

Another funny thing is that, in preview mode it works perfectly fine, whereas, in live it returns the message as follow. (Not even as an error).

Anybody has any idea, what am I doing wrong? Is there something that I can do?

Please help!

Did you sync the sandbox database to the Live?

Yes, I did. I can see the records in live DB which are expected to be fetched.

If you’ve got data in the Live database, then m ake sure that you have the correct collection permissions .

If the permissions are OK, then try a query without a filter and see what’s returned.

That’s it… I was totally missing out about the custom permissions for the table. For some reason I had set read permission to only the Site Author instead of Site member.

As soon as I changed this permission, it just worked like a charm. Thank you so much for your help.

Much Appreciated…!