NearSocial / standards

Standards to define schemas and data format in SocialDB
10 stars 8 forks source link

Multiple entries to the index #8

Closed evgenykuzyakov closed 1 year ago

evgenykuzyakov commented 1 year ago

To be able to send multiple notifications or multiple index entries in one call, the index should be able to accept such things.

Example:

An app wants to notify multiple users, e.g. Alice follows Bob and Charlie in one action. She can indicate this in the graph index in one call:

[
  {
    "key": "follow",
    "value": {
      "type": "follow",
      "accountId": "bob.near"
    }
  },
  {
    "key": "follow",
    "value": {
      "type": "follow",
      "accountId": "charlie.near"
    }
  }
]

This will be serialized to JSON and should be added under index/graph:

{
  "index": {
    "graph": "[{\"key\":\"follow\",\"value\":{\"type\":\"follow\",\"accountId\":\"bob.near\"}},{\"key\":\"follow\",\"value\":{\"type\":\"follow\",\"accountId\":\"charlie.near\"}}]"
  }
}