Skip to content

Commit 03b36f2

Browse files
committed
Issue mongodb#79: tree modeling
1 parent b2bd329 commit 03b36f2

7 files changed

+107
-30
lines changed

locale/zh/LC_MESSAGES/applications/data-models-tree-structures.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ msgstr ""
1313

1414
#: ../source/applications/data-models-tree-structures.txt:3
1515
msgid "Model Tree Structures"
16-
msgstr ""
16+
msgstr "树结构建模"
1717

1818
#: ../source/applications/data-models-tree-structures.txt:7
1919
msgid ""
2020
"MongoDB allows various ways to use tree data structures to model large "
2121
"hierarchical or nested data relationships."
22-
msgstr ""
22+
msgstr "MongoDB"
2323

2424
#: ../source/includes/toc/dfn-list-data-models-tree-structures.rst:7
2525
msgid ":doc:`/tutorial/model-tree-structures-with-parent-references`"

locale/zh/LC_MESSAGES/tutorial/model-referenced-one-to-many-relationships-between-documents.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ msgstr ""
1313

1414
#: ../source/tutorial/model-referenced-one-to-many-relationships-between-documents.txt:5
1515
msgid "Model One-to-Many Relationships with Document References"
16-
msgstr "一对多建模: 文档引用模式"
16+
msgstr "一对多关系建模: 文档引用模式"
1717

1818
#: ../source/tutorial/model-referenced-one-to-many-relationships-between-documents.txt:10
1919
msgid "Overview"

locale/zh/LC_MESSAGES/tutorial/model-tree-structures-with-ancestors-array.po

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@ msgstr ""
55
"Report-Msgid-Bugs-To: \n"
66
"POT-Creation-Date: 2014-09-03 15:39-0400\n"
77
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
8-
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8+
"Last-Translator: TJWORKS <[email protected]>\n"
99
"Language-Team: LANGUAGE <[email protected]>\n"
1010
"MIME-Version: 1.0\n"
1111
"Content-Type: text/plain; charset=UTF-8\n"
1212
"Content-Transfer-Encoding: 8bit\n"
1313

1414
#: ../source/tutorial/model-tree-structures-with-ancestors-array.txt:3
1515
msgid "Model Tree Structures with an Array of Ancestors"
16-
msgstr ""
16+
msgstr "树结构建模: 祖先数组"
1717

1818
#: ../source/tutorial/model-tree-structures-with-ancestors-array.txt:8
1919
msgid "Overview"
20-
msgstr ""
20+
msgstr "概述"
2121

2222
#: ../source/tutorial/model-tree-structures-with-ancestors-array.txt:10
2323
msgid ""
@@ -27,51 +27,63 @@ msgid ""
2727
":doc:`/core/data-models` for a full high level overview of data modeling in "
2828
"MongoDB."
2929
msgstr ""
30+
"MongoDB的数据具有 *灵活的模式* 。 :term:`集合 <collection>` 本身没有"
31+
"对文档结构的规则性校验。 但是你建模时所作的决定会影响到应用程序的性能和数据库的处理能力。"
32+
"参见 :doc:`/core/data-models` 以更多的了解一些关于MongoDB数据建模全面介绍。"
3033

3134
#: ../source/tutorial/model-tree-structures-with-ancestors-array.txt:16
3235
msgid ""
3336
"This document describes a data model that describes a tree-like structure in"
3437
" MongoDB documents using :ref:`references <data-modeling-referencing>` to "
3538
"parent nodes and an array that stores all ancestors."
3639
msgstr ""
40+
"这篇文章讲述如何使用在子文档内对父文档及所有祖先文档进行 :ref:`引用 <data-modeling-referencing>` "
41+
"的方式来对树结构文档建模。"
3742

3843
#: ../source/tutorial/model-tree-structures-with-ancestors-array.txt:22
3944
msgid "Pattern"
40-
msgstr ""
45+
msgstr "范式"
4146

4247
#: ../source/tutorial/model-tree-structures-with-ancestors-array.txt:26
4348
msgid ""
4449
"The *Array of Ancestors* pattern stores each tree node in a document; in "
4550
"addition to the tree node, document stores in an array the id(s) of the "
4651
"node's ancestors or path."
4752
msgstr ""
53+
"*祖先数组* 模式用一个文档来表示树的一个节点。每一个文档除了存储节点的信息,"
54+
"同时也存储了对父文档及祖先文档的id值。"
4855

4956
#: ../source/tutorial/model-tree-structures-with-ancestors-array.txt:30
5057
msgid "Consider the following hierarchy of categories:"
51-
msgstr ""
58+
msgstr "让我们看一下下图表示的树形分类结构:"
5259

5360
#: ../source/tutorial/model-tree-structures-with-ancestors-array.txt:34
5461
msgid ""
5562
"The following example models the tree using *Array of Ancestors*. In "
5663
"addition to the ``ancestors`` field, these documents also store the "
5764
"reference to the immediate parent category in the ``parent`` field:"
5865
msgstr ""
66+
"下面是一个使用 *祖先数组* 的例子。除了 ``ancestors`` 字段之外,这些文档"
67+
"还使用 ``parent`` 字段保存对父节点的引用: "
5968

6069
#: ../source/tutorial/model-tree-structures-with-ancestors-array.txt:47
6170
msgid ""
6271
"The query to retrieve the ancestors or path of a node is fast and "
6372
"straightforward:"
6473
msgstr ""
74+
"查询一个节点所有祖先节点或者从根节点到某个节点的路径的操作很快很方便:"
6575

6676
#: ../source/tutorial/model-tree-structures-with-ancestors-array.txt:54
6777
msgid ""
6878
"You can create an index on the field ``ancestors`` to enable fast search by "
6979
"the ancestors nodes:"
7080
msgstr ""
81+
"可以对 ``ancestors`` 字段建索引,这样可以快速的按祖先节点查找:"
7182

7283
#: ../source/tutorial/model-tree-structures-with-ancestors-array.txt:61
7384
msgid "You can query by the field ``ancestors`` to find all its descendants:"
7485
msgstr ""
86+
"你可以使用 ``ancestors`` 字段来查找某个节点所有的子代节点:"
7587

7688
#: ../source/tutorial/model-tree-structures-with-ancestors-array.txt:67
7789
msgid ""
@@ -80,10 +92,15 @@ msgid ""
8092
" elements of the ancestors field. This makes *Array of Ancestors* a good "
8193
"choice for working with subtrees."
8294
msgstr ""
95+
"*祖先数组* 模式为需要在树结构里查找某个子树节点以及某个节点的所有祖先节点的场景"
96+
"提供了一个快速有效的方案。对于经常需要操作子树的场景,这是个很好的选择。"
8397

8498
#: ../source/tutorial/model-tree-structures-with-ancestors-array.txt:72
8599
msgid ""
86100
"The *Array of Ancestors* pattern is slightly slower than the "
87101
":doc:`Materialized Paths </tutorial/model-tree-structures-with-materialized-"
88102
"paths>` pattern but is more straightforward to use."
89103
msgstr ""
104+
"*祖先数组* 模式的效率比起 "
105+
":doc:`Materialized Paths </tutorial/model-tree-structures-with-materialized-"
106+
"paths>` 模式来稍微要慢一些,但是使用起来比较容易。"

locale/zh/LC_MESSAGES/tutorial/model-tree-structures-with-child-references.po

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@ msgstr ""
55
"Report-Msgid-Bugs-To: \n"
66
"POT-Creation-Date: 2014-09-03 15:39-0400\n"
77
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
8-
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8+
"Last-Translator: TJWORKS <[email protected]>\n"
99
"Language-Team: LANGUAGE <[email protected]>\n"
1010
"MIME-Version: 1.0\n"
1111
"Content-Type: text/plain; charset=UTF-8\n"
1212
"Content-Transfer-Encoding: 8bit\n"
1313

1414
#: ../source/tutorial/model-tree-structures-with-child-references.txt:3
1515
msgid "Model Tree Structures with Child References"
16-
msgstr ""
16+
msgstr "树结构建模: 子文档引用"
1717

1818
#: ../source/tutorial/model-tree-structures-with-child-references.txt:8
1919
msgid "Overview"
20-
msgstr ""
20+
msgstr "概述"
2121

2222
#: ../source/tutorial/model-tree-structures-with-child-references.txt:10
2323
msgid ""
@@ -27,52 +27,65 @@ msgid ""
2727
":doc:`/core/data-models` for a full high level overview of data modeling in "
2828
"MongoDB."
2929
msgstr ""
30+
"MongoDB的数据具有 *灵活的模式* 。 :term:`集合 <collection>` 本身没有"
31+
"对文档结构的规则性校验。 但是你建模时所作的决定会影响到应用程序的性能和数据库的处理能力。"
32+
"参见 :doc:`/core/data-models` 以更多的了解一些关于MongoDB数据建模全面介绍。"
33+
3034

3135
#: ../source/tutorial/model-tree-structures-with-child-references.txt:16
3236
msgid ""
3337
"This document describes a data model that describes a tree-like structure in"
3438
" MongoDB documents by storing :ref:`references <data-modeling-referencing>` "
3539
"in the parent-nodes to children nodes."
3640
msgstr ""
41+
"这篇文章讲述如何使用在父文档内对子文档进行 :ref:`引用 <data-modeling-referencing>` "
42+
"的方式来对树结构文档建模。"
3743

3844
#: ../source/tutorial/model-tree-structures-with-child-references.txt:21
3945
msgid "Pattern"
40-
msgstr ""
46+
msgstr "范式"
4147

4248
#: ../source/tutorial/model-tree-structures-with-child-references.txt:25
4349
msgid ""
4450
"The *Child References* pattern stores each tree node in a document; in "
4551
"addition to the tree node, document stores in an array the id(s) of the "
4652
"node's children."
4753
msgstr ""
54+
"*子文档引用* 模式用一个文档来表示树的一个节点。每一个文档除了存储节点的信息,"
55+
"同时也用一个数组来保存该节点所有子节点的id值。"
4856

4957
#: ../source/tutorial/model-tree-structures-with-child-references.txt:29
5058
msgid "Consider the following hierarchy of categories:"
5159
msgstr ""
60+
msgstr "让我们看一下下图表示的树形分类结构:"
5261

5362
#: ../source/tutorial/model-tree-structures-with-child-references.txt:33
5463
msgid ""
5564
"The following example models the tree using *Child References*, storing the "
5665
"reference to the node's children in the field ``children``:"
5766
msgstr ""
67+
"下面是一个使用 *子文档引用* 的例子。在 ``children`` 字段里保存了对所有下一级分类节点的引用。"
5868

5969
#: ../source/tutorial/model-tree-structures-with-child-references.txt:45
6070
msgid ""
6171
"The query to retrieve the immediate children of a node is fast and "
6272
"straightforward:"
6373
msgstr ""
74+
"查询直接子节点的操作很快很方便:"
6475

6576
#: ../source/tutorial/model-tree-structures-with-child-references.txt:52
6677
msgid ""
6778
"You can create an index on the field ``children`` to enable fast search by "
6879
"the child nodes:"
6980
msgstr ""
81+
"可以对 ``children`` 字段建索引,这样可以快速的按子节点查找:"
7082

7183
#: ../source/tutorial/model-tree-structures-with-child-references.txt:59
7284
msgid ""
7385
"You can query for a node in the ``children`` field to find its parent node "
7486
"as well as its siblings:"
7587
msgstr ""
88+
"你可以通过 ``children`` 字段很快的找到一个节点的父节点以及同级的节点:"
7689

7790
#: ../source/tutorial/model-tree-structures-with-child-references.txt:66
7891
msgid ""
@@ -81,3 +94,5 @@ msgid ""
8194
"provide a suitable solution for storing graphs where a node may have "
8295
"multiple parents."
8396
msgstr ""
97+
"*子文档引用* 模式在不要求对分支进行操作的场景下是一个比较不错的树结构建模方案。另外"
98+
"对一个节点多个父节点的图结构也有不错的支持。"

locale/zh/LC_MESSAGES/tutorial/model-tree-structures-with-materialized-paths.po

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@ msgstr ""
55
"Report-Msgid-Bugs-To: \n"
66
"POT-Creation-Date: 2014-09-03 15:39-0400\n"
77
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
8-
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8+
"Last-Translator: TJWORKS <[email protected]>\n"
99
"Language-Team: LANGUAGE <[email protected]>\n"
1010
"MIME-Version: 1.0\n"
1111
"Content-Type: text/plain; charset=UTF-8\n"
1212
"Content-Transfer-Encoding: 8bit\n"
1313

1414
#: ../source/tutorial/model-tree-structures-with-materialized-paths.txt:3
1515
msgid "Model Tree Structures with Materialized Paths"
16-
msgstr ""
16+
msgstr "树结构建模: 物化路径(Materialized Paths)"
1717

1818
#: ../source/tutorial/model-tree-structures-with-materialized-paths.txt:8
1919
msgid "Overview"
20-
msgstr ""
20+
msgstr "概述"
2121

2222
#: ../source/tutorial/model-tree-structures-with-materialized-paths.txt:10
2323
msgid ""
@@ -27,16 +27,20 @@ msgid ""
2727
":doc:`/core/data-models` for a full high level overview of data modeling in "
2828
"MongoDB."
2929
msgstr ""
30+
"MongoDB的数据具有 *灵活的模式* 。 :term:`集合 <collection>` 本身没有"
31+
"对文档结构的规则性校验。 但是你建模时所作的决定会影响到应用程序的性能和数据库的处理能力。"
32+
"参见 :doc:`/core/data-models` 以更多的了解一些关于MongoDB数据建模全面介绍。"
3033

3134
#: ../source/tutorial/model-tree-structures-with-materialized-paths.txt:16
3235
msgid ""
3336
"This document describes a data model that describes a tree-like structure in"
3437
" MongoDB documents by storing full relationship paths between documents."
3538
msgstr ""
39+
"这篇文章讲述使用一种在节点文档中保存完整的文档关系的方式来实现树结构建模。"
3640

3741
#: ../source/tutorial/model-tree-structures-with-materialized-paths.txt:21
3842
msgid "Pattern"
39-
msgstr ""
43+
msgstr "范式"
4044

4145
#: ../source/tutorial/model-tree-structures-with-materialized-paths.txt:25
4246
msgid ""
@@ -47,58 +51,74 @@ msgid ""
4751
"pattern also provides more flexibility in working with the path, such as "
4852
"finding nodes by partial paths."
4953
msgstr ""
50-
54+
"*物化路径(Materialized Paths)* 模式用一个文档保存树结构中的一个节点。"
55+
"除此之外, 这些文档也会保存一个从根节点到当前节点完整路径节点的id组成的一个"
56+
"字符串,称之为 *物化路径*。虽然 *物化路径* 本身需要一些额外的字符串处理,"
57+
"但是这种模式在和路径相关的操作方面会更加灵活,如基于部分路径的节点搜索。"
58+
5159
#: ../source/tutorial/model-tree-structures-with-materialized-paths.txt:33
5260
msgid "Consider the following hierarchy of categories:"
53-
msgstr ""
61+
msgstr "让我们看一下下图表示的树形分类结构:"
5462

5563
#: ../source/tutorial/model-tree-structures-with-materialized-paths.txt:37
5664
msgid ""
5765
"The following example models the tree using *Materialized Paths*, storing "
5866
"the path in the field ``path``; the path string uses the comma ``,`` as a "
5967
"delimiter:"
6068
msgstr ""
69+
"下面是一个使用 *物化路径* 来建模的例子。在节点文档中的 ``path`` 字段保存了以逗号为"
70+
"分隔符的路径字符串。"
6171

6272
#: ../source/tutorial/model-tree-structures-with-materialized-paths.txt:50
6373
msgid ""
6474
"You can query to retrieve the whole tree, sorting by the field ``path``:"
6575
msgstr ""
76+
"你可以查询整个树的所有节点并按 ``path`` 排序:"
6677

6778
#: ../source/tutorial/model-tree-structures-with-materialized-paths.txt:57
6879
msgid ""
6980
"You can use regular expressions on the ``path`` field to find the "
7081
"descendants of ``Programming``:"
7182
msgstr ""
83+
"你可以在 ``path`` 字段上使用正则表达式来查询 ``Programming`` 的所有子代节点:"
7284

7385
#: ../source/tutorial/model-tree-structures-with-materialized-paths.txt:64
7486
msgid ""
7587
"You can also retrieve the descendants of ``Books`` where the ``Books`` is "
7688
"also at the topmost level of the hierarchy:"
7789
msgstr ""
90+
"你也可以查询到根节点 ``Books`` 的所有子代节点:"
7891

7992
#: ../source/tutorial/model-tree-structures-with-materialized-paths.txt:71
8093
msgid "To create an index on the field ``path`` use the following invocation:"
8194
msgstr ""
95+
"你可以在 ``path`` 字段上创建索引: "
8296

8397
#: ../source/tutorial/model-tree-structures-with-materialized-paths.txt:78
8498
msgid "This index may improve performance depending on the query:"
8599
msgstr ""
100+
"这个索引对某些查询的性能会有所提高:"
86101

87102
#: ../source/tutorial/model-tree-structures-with-materialized-paths.txt:80
88103
msgid ""
89104
"For queries of the ``Books`` sub-tree (e.g. ``/^,Books,/``) an index on the "
90105
"``path`` field improves the query performance significantly."
91106
msgstr ""
107+
"如果从根节点开始查询,(e.g. ``/^,Books,/``) , ``path`` 字段上的索引会对提高查询性能有"
108+
"显著的作用。"
92109

93110
#: ../source/tutorial/model-tree-structures-with-materialized-paths.txt:84
94111
msgid ""
95112
"For queries of the ``Programming`` sub-tree (e.g. ``/,Programming,/``), or "
96113
"similar queries of sub-tress, where the node might be in the middle of the "
97114
"indexed string, the query must inspect the entire index."
98115
msgstr ""
116+
"如果查询类似于 ``Programming`` 这些非根节点下面的子代节点, (e.g. ``/,Programming,/``)"
117+
"由于这些被查询的节点可能在索引字符串的中部而导致全索引扫描。"
99118

100119
#: ../source/tutorial/model-tree-structures-with-materialized-paths.txt:89
101120
msgid ""
102121
"For these queries an index *may* provide some performance improvement *if* "
103122
"the index is significantly smaller than the entire collection."
104123
msgstr ""
124+
"在这种情况下,索引只会在索引所占空间远小于数据所占空间的情况下才会对性能提高有帮助。"

0 commit comments

Comments
 (0)