Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8060385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:58:38+00:00 2026-06-05T09:58:38+00:00

is this the way you would store currency exchange rates for mongoDB? It does

  • 0

is this the way you would store currency exchange rates for mongoDB?
It does work for us, but some limitations I see if its going to be hard for us to do a date/time search instead what we will have to do is split the date and time and then place it in a select drop down or something.

Please give me your views.

{
   "currentexchange": {
     "0": {
       "to": "NZD",
       "rate": "1.2879",
       "updated": "8: 42pm" 
    },
     "1": {
       "to": "USD",
       "rate": "0.9777",
       "updated": "8: 42pm" 
    },
     "2": {
       "to": "KWD",
       "rate": "0.2739",
       "updated": "8: 42pm" 
    },
     "3": {
       "to": "GBP",
       "rate": "0.6354",
       "updated": "8: 42pm" 
    } 
  },
   "exchangehistory": {
     "2012-06-06T09: 51: 25+10: 00": {
       "0": {
         "to": "NZD",
         "rate": "1.2875" 
      },
       "1": {
         "to": "USD",
         "rate": "0.9768" 
      },
       "2": {
         "to": "KWD",
         "rate": "0.2742" 
      },
       "3": {
         "to": "GBP",
         "rate": "0.6351" 
      } 
    },
     "2012-06-06T10: 00: 09+10: 00": {
       "0": {
         "to": "NZD",
         "rate": "1.288" 
      },
       "1": {
         "to": "USD",
         "rate": "0.9774" 
      },
       "2": {
         "to": "KWD",
         "rate": "0.2743" 
      },
       "3": {
         "to": "GBP",
         "rate": "0.6354" 
      } 
    },
     "2012-06-06T10: 15: 07+10: 00": {
       "0": {
         "to": "NZD",
         "rate": "1.2878" 
      },
       "1": {
         "to": "USD",
         "rate": "0.978" 
      },
       "2": {
         "to": "KWD",
         "rate": "0.274" 
      },
       "3": {
         "to": "GBP",
         "rate": "0.6357" 
      } 
    },
     "2012-06-06T10: 30: 10+10: 00": {
       "0": {
         "to": "NZD",
         "rate": "1.2873" 
      },
       "1": {
         "to": "USD",
         "rate": "0.977" 
      },
       "2": {
         "to": "KWD",
         "rate": "0.2737" 
      },
       "3": {
         "to": "GBP",
         "rate": "0.6352" 
      } 
    },
     "2012-06-06T10: 45: 08+10: 00": {
       "0": {
         "to": "NZD",
         "rate": "1.2879" 
      },
       "1": {
         "to": "USD",
         "rate": "0.9777" 
      },
       "2": {
         "to": "KWD",
         "rate": "0.2739" 
      },
       "3": {
         "to": "GBP",
         "rate": "0.6354" 
      } 
    } 
  },
   "from": "AUD" 
}

So how we plain on using this.

When a user wants to withdraw money, we need to be able to get the exchange rate that they requested the withdrawal.

We also need to be able to do LIVE conversion rate changes if a user has two types of currencies and say there default is AUD and they are paying someone in USD then we need to convert it, or if they dont have enough USD and they have AUD then we need to dip into there AUD and convert some to pay the rest of the charge.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T09:58:42+00:00Added an answer on June 5, 2026 at 9:58 am

    There are a couple of issues to consider here: use of IDs & multiple collections

    Use of Ids

    Your data format seems off. Consider the following in a currentExchange collection:

    "_id" : "AUD",
    "NZD": { "rate": "1.2879", "updated": "8: 42pm" },
    "USD": { "rate": "0.9777", "updated": "8: 42pm" },
     ...
    

    This will be the easiest layout to query.

    Multiple Collections

    You will want to break out currentExchange and exchangeHistory into two collections. You want the currentExchange to remain small and it will leverage different indexes.

    As you designed it, your document would become very large and then fail.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The conventional way of doing this would be $row = mysql_fetch_array($query); echo $row['column']; but
I'm using mongodb and I store datetime in my database in this way for
I have an array which contains another array Would I notate it this way?
Would this be a proper way to dispose of a BackGroundWorker? I'm not sure
Would this be the correct way of declaring that an XML element Cluster contains
what would be the shortest way to write this? if(strpos($haystack, $needle)!==false){ $len = strpos($haystack,
I would like to ask is there any way to achieve this functionality: I
I guess another way to phrase this would be Is there a class like
I have this string: B82V16814133260 what would be the most efficient way to get
I have trouble finding way to correctly refactor this code so that there would

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.