Error when searching via a boolean field

When I try to search via a boolean field, if at least one document isn't toggled to true I get the following error. It should return an empty array instead of returning error.

Hi @rodrigo.ramos,

I will try to reproduce this issue and investigated it

It would be useful if you can share with us your repository name (in a private message if necessary) as well as a link to that query

I have done some tests, and I've been able to reproduce the issue,

And so the current behavior is that when you create a new field with a default value after creating the document, the default value doesn't work and stays null.

This is certainly a bug, and the expected behavior is that you have to unpublish and publish the documents for the default values to be assigned. Currently, that doesn't happen as you need to set the value manually document by document.

Another bug here is that when [at(my.lesson.featured, true)] should not throw an error and instead return nothing if the no changes (new version) of the document has been done (a null value shouldn't exist in my opinion) or the API should ignore the unassigned fields if they are not published.

So for that, I will create an issue in our tracker, and I will let you know in case of any updates.

Thanks for the heads-up!

We've added a workaround on our side that if we're searching with this query and it returns an error it actually means there is no content but we hope to change this in the future if you implement a fix for this issue :wave:

1 Like

Thanks for sharing this workaround.

Hi @rodrigo.ramos,

A quick update on this issue, our dev team, confirms it's an editor issue, and we will be taken care of in an ongoing redo of the editor.