Document Properties

A Document as JSON

{
  "id": "1065ff43-2181-4880-905d-bc1d6caefe4e",
  
  // document-key
  "key": "MSProSAP.Invoice",
  "context": null,
  "userId": "24-001",
  
  // document-indentifier = document-key [rank]
  "rank": 0,
  
  // Content
  "contentType": "application/json",
  "content": "{ \"Prop1\" : \"abc\" }",
  
  // User-State
  "userState" : 99,
  "userInfo" : "ERR: Duplicate Invoice",
  
  // State
  "lastUpdateUtc": "2024-05-22T17:57:13.585Z",
  "createdDateUtc": "2024-05-22T17:57:13.585Z",
  
  "clientId": "MyLaptop",
  "clientVersion": 1716400633585,
    
  // Lifetime
  "expirationDateUtc": "2024-05-22T18:57:13.585Z"
}

The Document's Index is a unique reference to a document.

The id is always unique. The Id can be client-provided when creating a new Document or it is created by the service and responded to the client.

Document identifier: Either id or the document-key (key,context,userId) is used to identify an existing record. When the document-key is provided the key field is mandatory, while context and userId are optional. Multiple documents with the same document-key can co-exist with a different rank. The rank used as an indexer: document-key [rank] -> document.

Property
Description

key (mandatory)

The key is the type-name of the document. It describes what the document contains. I recommend to using namespaces for keys. Example: MSPro.Templates.WelcomeEMail

context (default = null)

The context describes the context in which the current document exists. You can use, for example a ServiceReferenceID an execution-id etc. You may compare the Context with a directory in your filesystem. Example: Key=MSPro.Inbound.ServiceRequest; Context=<CustomerName>

userId (default = null)

The UserId was introduced to support an index that came with the document itself. For example, an external key/id like an invoice-id.

rank (default = 0)

Rank is used to store multiple documents (Array) with the same document-key information.

Last updated