How to create a document with JSON object ID


#1

Is it possible to use a JSON object as the document ID? For example an array like the following used as a key: [“key”, [“key1”, “key2”]]

Right not database.document(documentID) only takes a string I think,


#2

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,