Thanks for bringing this up. I've tested on my end and have been able to replicate the behaviour you've described. I've raised the issue with our developers for further investigation. As soon as I have an update to share, I will post here to let you know.
Thanks for the reply.
I do notice now that I used the property discountCode instead of what probably should have been discount_code in the filter. However, it still didn't solve the problem. I still received results with null discount codes.
I suspect the problem is that discountCode simply isn't a property you can filter by. If that is the case, It would be nice if there were an error to let me know that.
"This query can be combined with a Not Query to find fields missing a value, e.g. -published_at:*" (https://shopify.dev/concepts/about-apis/search-syntax)
You must have just forgotten the "-" before "discount_code"
Thanks for the response.
I'm not trying to find null discount codes if that's what you were thinking. I'm specifically trying to find non-null discount codes. But the "*" referenced in that link doesn't seem to be working, and orders with null discount values are coming back.
*edited to fix typo