Last active
August 29, 2015 14:08
-
-
Save hyzhak/fb6175e6a0072128b0c1 to your computer and use it in GitHub Desktop.
i18n of MongoDB (Mongoose) - normalization vs de-normalization
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // de-normalized | |
| { | |
| "_id": <ObjectId1>, | |
| "name": { | |
| "en": "Eugene", | |
| "uk": "Євген" | |
| } | |
| } | |
| //or normalized | |
| //1st data collection | |
| { | |
| "_id": <ObjectId1>, | |
| "name": "1"//reference to id of 2nd collection | |
| } | |
| //2nd i18n collection | |
| [ | |
| { | |
| "_id": <ObjectId2>, | |
| "id": "1", //reference to name of 1nd collection | |
| "value": "Eugene" | |
| }, | |
| { | |
| "_id": <ObjectId2>, | |
| "id": "1", //reference to name of 1nd collection | |
| "value": "Євген" | |
| } | |
| ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment