Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metadata not returning on transactions #9

Open
lnmunhoz opened this issue Sep 12, 2020 · 4 comments · Fixed by #12
Open

Metadata not returning on transactions #9

lnmunhoz opened this issue Sep 12, 2020 · 4 comments · Fixed by #12

Comments

@lnmunhoz
Copy link

When creating or fetching transactions, the metadata is not returned.

To reproduce:

  1. Given the transaction created with this payload:
{
    "from": "lucas",
    "to": "andrios",
    "amount": 100,
    "currency": "BRL",
    "metadata": [{
        "test": true
    }]
}
  1. I should get back two transactions with the same metadata, but what I get back does not contain metadata:
[
    {
        "amount": 100,
        "date": "2020-09-12T09:21:23.764Z",
        "currency": "BRL",
        "balance": 500,
        "from": "lucas",
        "id": "16ea0f46389d2511cae81954309a339b",
        "to": "andrios"
    },
    {
        "amount": 100,
        "date": "2020-09-12T09:21:23.767Z",
        "currency": "BRL",
        "balance": 100,
        "from": "lucas",
        "id": "c44eacd2b08586b54b4ab179fdea09af",
        "to": "andrios"
    }
]
@lnmunhoz
Copy link
Author

Also, would be nice to query transactions by metadata. Is that something you consider to implement?

@andriosrobert
Copy link
Contributor

@lnmunhoz solved in #12

@andriosrobert
Copy link
Contributor

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?

@lgrkvst
Copy link

lgrkvst commented Sep 17, 2020

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" 😅 ...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants