Using alasql, I'm trying to insert a value into an array that is a value of a property only if it doesn't already exist. It's set up like this:
[{"name": "Bob", "assocIDs": [1, 5, 10]}, {...}]
I'd like to be able to insert 6 into assocIDs only if it isn't already there, for instance. I've tried combinations of IF SELECT WHERE IN etc and can't seem to find the proper combination. Any hints on how to do this? For reference, I'm working strictly off JSON in browser.
I can do this the long way, select out the array, check it, insert if not there, and then update the record, but I'd like to do it properly.