I have a few thousand strings (items) that I would like to translate. I have structured my MongoDB as follows:
@document = {:item => "hello", :translations => {:fr => {:name => "bonjour",
:note => "easy"}, :es => {:name => "hola", :note => "facil"}}}
The :translations field can contain many more languages and properties. I would like to run queries such as retrieving all items with no translations for a specific language, or retrieving all items having ‘bonjour’ as a French translation.
I don’t see how I can do this. Is there a better way to structure my database for these purposes? I am using node.js.
Thanks.
I believe that you have the correct structure. You will have to become familiar with the Dot Notation.