Skip to content

Commit f35e990

Browse files
jwierzboSimran-B
andauthored
Improve Document API (#348)
* Improve Document API * Improve Document API * Review --------- Co-authored-by: Simran Spiller <[email protected]>
1 parent c3748ef commit f35e990

File tree

6 files changed

+357
-291
lines changed

6 files changed

+357
-291
lines changed

site/content/3.10/concepts/data-structure/documents/_index.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,17 @@ Example document:
6060
All documents contain special attributes at the top-level that start with an
6161
underscore, known as **system attributes**:
6262

63-
- The **document identifier** is stored as a string in the `_id` attribute.
6463
- The **document key** is stored as a string in the `_key` attribute.
64+
- The **document identifier** is stored as a string in the `_id` attribute.
6565
- The **document revision** is stored as a string in the `_rev` attribute.
6666

6767
You can specify a value for the `_key` attribute when creating a document.
68+
The `_id` attribute is automatically set based on the collection and `_key`.
6869
The `_id` and `_key` values are immutable once the document has been created.
6970
The `_rev` value is maintained by ArangoDB automatically.
7071

7172
Edge documents in edge collections have two additional system attributes:
73+
7274
- The document identifier of the source vertex stored in the `_from` attribute.
7375
- The document identifier of the target vertex stored in the `_to` attribute.
7476

@@ -80,6 +82,9 @@ you should avoid using own attribute names starting with an underscore.
8082
Each document has a unique **document key** (or _primary key_) which identifies
8183
it within its collection.
8284

85+
To distinguish between documents from multiple collections, see
86+
[Document identifiers](#document-identifiers).
87+
8388
A document key uniquely identifies a document in the collection it is
8489
stored in. It can and should be used by clients when specific documents
8590
are queried. The document key is stored in the `_key` attribute of
@@ -157,6 +162,10 @@ forward slash (`/`), like `collection-name/document-key`.
157162
See [Collection names](../collections.md#collection-names) and
158163
[Document keys](#document-keys) for information about the allowed characters.
159164

165+
When working with documents from multiple collections, you can see what
166+
collections they are from by looking at the `_id` attribute values and tell
167+
documents from different collections but the same keys apart.
168+
160169
### Document revisions
161170

162171
Every document in ArangoDB has a revision, stored in the system attribute

0 commit comments

Comments
 (0)