Open lnmunhoz opened 4 years ago
Also, would be nice to query transactions by metadata. Is that something you consider to implement?
@lnmunhoz solved in #12
Also, would be nice to query transactions by metadata. Is that something you consider to implement?
I thought about it, but don't think this is a good idea. Mostly because this is a dynamic field. There is no way we can build an efficient index to be queried on the data if we don't know it. Things like cardinality are very important for indexes.
Can you explain a bit of your use case?
The simplest use-case I can think of is merely searching/filtering transactions, e.g. if I consistently store tx messages in metadata["message"], or location of a purchase, if available, in metadata["WGS84"], the use-case would be to filter all transactions that has the tx message walmart.
(The location use-case on the other hand becomes hardcore pretty quickly: "give me all transactions in a 10 km radius around 55.276192,-5.3228631" 😅 ...)
When creating or fetching transactions, the metadata is not returned.
To reproduce:
Given the transaction created with this payload:
I should get back two transactions with the same metadata, but what I get back does not contain metadata: