K
K
Konstantin2020-12-01 02:01:04
MongoDB
Konstantin, 2020-12-01 02:01:04

How to specify in which currency the payment was made?

Do you think it would be better to store an additional field in the document indicating the code of the currency in which the payment was made:

{  
  "price": 20.52,
  "cuurency": "USD"
}


Or would it be better to shove it into one field? Are there other smarter options?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
rPman, 2020-12-01
@Junart1

Miscellaneous fields
So that you can count without parsing your string '$10' or '10 USD' or '10 bucks' Use standard
currency codes

A
Andrey Gavrilov, 2020-12-01
@thexaver

Options:
Use one currency
Create a separate list of currencies

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question