Document with mutiple language support

16 views
Skip to first unread message

spokhr...@gmail.com

unread,
Aug 16, 2017, 7:34:49 PM8/16/17
to mongodb-user
Hi,

I need to have same content in multiple languages.
example is below:

{
  name : "name1",
  category" : "category1",
  subcategory: "subcategory1",
  tags: "tag1, tag2",
  language: "english".
  spanish: { //sub items will be in spanish
      name : "name1",
      category" : "category1",
      subcategory: "subcategory1",
      tags: "tag1, tag2"
  }
}

In am finding it hard what approach to take. Keep them in different documents or club them in one document as above.
I have gone through the below link but it didn't help much.

Please advice. There will be lots of content to be added so performance is also a factor to keep in mind.

Thanks,
Sumit.

Wan Bachtiar

unread,
Sep 4, 2017, 3:14:12 AM9/4/17
to mongodb-user

I have gone through the below link but it didn’t help much.

Hi Sumit,

Could you clarify what you are still having problem with ? Please include specific querying use case and what is the problem you’re trying to solve.

Worth noting that Text Index supports text search queries on string content. i.e. description. If you only have a field with a single world value i.e. category, you may not need text index. See Single Field Indexes

Regards,

Wan.

Reply all
Reply to author
Forward
0 new messages