Hi Harry,
So one of the exclusions I mentioned is that arrays will fall down any time you do concurrent edits. So if multiple users will be updating the lists, then you'll definitely want to move to a different model. A good alternative is to turn the product ids into the keys and use a truthy value for them:
Categories
CategoryName
ProductId: true
ProductId: true
ProductId: true
To make this work for the short term, you want to write the entire array, not just the changed element, and you'll want to
use a transaction (so concurrent edits don't blow away other users' changes).
You don't necessarily gain anything by using a Function to do this--the requirements are the same there as doing it directly from the client. But it's certainly possible if that makes your job easier.
☼, Kato