我有几千个字符串(items
),我想要翻译。我已经构建了我的MongoDB,如下所示:带嵌入式文档的MongoDB数据库设计
@document = {:item => "hello", :translations => {:fr => {:name => "bonjour",
:note => "easy"}, :es => {:name => "hola", :note => "facil"}}}
:translations字段可以包含更多的语言和属性。我想运行查询,例如检索所有没有特定语言翻译的项目,或者检索所有具有“bonjour”作为法语翻译的项目。
我不明白我该怎么做。有没有更好的方法来构建我的数据库用于这些目的?我正在使用node.js.
谢谢。