Is it recommended (from functionality/performance pov) to create an "all index"? so like "allPosts"

Two ways I can get all documents in a collection, like posts for example.

1:

Paginate(
  Documents(
    Collection('posts')
  ),
  { size: 100 }
)

2:

Paginate(
  Index('allPosts'),
  { size: 100 }
)

Both works as expected, but which one should I use?

Collection indexes, those without terms and values specified, were the recommendation prior to the existence of the Documents function.

With the Documents function, we no longer recommend collection indexes.

Both techniques serve the identical purpose, but creating a collection index is increasing your storage and write operations needlessly.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.