How to create a document with JSON object ID

Not sure why you would want to do that. This is something you can do with views. Then when querying the view you can actually use the array to do grouping.

If you are just using Key/Value get, the only action you can do is give the Id directly to retrieve the corresponding doc. So it’s not really useful to format it as an array. You can use predeterministic structures but it does not seem to fit your use case,