Skip to content

API: Query JSON Metadata

I've talked about this with @dan shortly before and the idea is to be able to store data within the users JSON meta-data and being able to query it directly.

Example:

My app has a user with id 123 and the user connects a Hive account and adds appId: 123 to the meta-data. I'm then able to query metadata via API to get hive account where appId within json_metadata or posting_json_metadata equals 123.

API structure would be:

type KeyType = 'posting' | 'active'

queryJsonMetadata(
key: string,
value: string,
type: KeyType | KeyType[]
): HiveAccount | HiveAccount[]

Raw SQL is something like

SELECT * FROM "users" WHERE CAST ("posting_json_metadata" -> key AS STRING) = value

Would be great if this could get a somewhat high priority as certain features within my app depend on this API functionality.

Edited by therealwolf