Array vs nested array - Max size and performance impact

Hi,

We are exploring two different ways of modelling our docs:

  1. Array of userGroups per doc.
  2. Nested array of userGroups per doc.

Percentiles of userGroups per doc: p100 = 23,795 userGroups, p99.9 = 1,190 userGroups, p99 = 650 userGroups, p95 = 311 userGroups and p50 = 51 userGroups.

Some questions:

  1. Is there any limit in the max size of arrays and nested arrays?
  2. At query time, we would be passing a single userGroup value and would expect to get docs that contain that userGroup in their array of userGroups. Is there any guidance on which option (array vs nested array) would give us the best latency?

Thanks.