Azure/azure-cosmos-js

[v3] Partition Key Changes

Closed this issue · 1 comments

v3 Partition Key related behaviors

  1. SDK should use new API version "2018-12-31"
    • new API version blocks creation of single partition containers and makes existing ones appear to be partitioned (with everything in the default partition key EMPTY_PARTITION_KEY
  2. SDK should transparently handle detecting system defined partition key and pass the correct EMPTY_PARTITION_KEY header. "[{}]" should be used for non-migrated containers. [] should be used for migrated containers.
  3. SDK should allow users to pass the partition key value explicitly
    • note, that it still has to match what is in the body that is sent to the backend
  4. SDK should implicitly infer non-undefined/empty partition keys if it is not specified explicitly
    • Note, users must specify the partition key explicitly if it is empty/undefined. This is intended to prevent errors. Open for feedback, though.
  5. SDK should always send a partition key definition to the backend on container create. if one is not specified, a default "_partitionKey" value will be used.
  6. SDK should export a DEFAULT_PARTITION_KEY constant which can be used to indicate empty or undefined.

Closed by #308