Rank
Arrays - Multiple documents with the same Key
Last updated
Arrays - Multiple documents with the same Key
Last updated
The Rank
allows you to have multiple documents under the same Key and Context
If you POST a document without providing an explicit Rank
this is always an insert, and a new document is created with the next available rank (highest rank +1). With reference to Pic 1 the next Rank would be 5 +1 = 6.
If you provide a specific Rank, an existing document is updated. A new document is created, if there is a no document with that Rank (insert).
You can optionally provide a MinRank
to control the next rank that is created. Normally, the next rank is highest available rank +1. If you provide a MinRank
the next rank is minimum that number.
Example: Imagine the highest rank for document of Key="MSPro.Test.Invoice" is 5. You POST a new document with that Key - omitting an explicit rank - but providing a MinRank
of 10. Then a next document created will have Rank=10 (not 6!).