meds
meds

Reputation: 22926

Multiple order bys in cosmos

I'm working on a sorting system that has 5 fields that can be sorted by in any arbitrary order and direction.

Cosmos does not support order by on multiple fields without a composite index.

My solution is to create a composite index programatically as order by queries are made by the user - is this a scalable or 'correct' solution?

Otherwise how would I make cosmos work properly in this situation?

Upvotes: 2

Views: 1022

Answers (1)

Mark Brown
Mark Brown

Reputation: 8763

Doing what you suggest is not scalable as it takes time to build the index. If you want queries to work when called you will need to create the index ahead of time.

Upvotes: 4

Related Questions