Monday, 28 June 2021

ArangoDB: Document

Document represents the actual content that we want to store to a collection. Document closely resembles the JSON format. A document can have zero more attributes and each attribute has a value assoiciated with it.

 

An attribute value can be either a primitive type like number, string, boolean or null (or) a compound type like an array or json document.

 

Is ArangoDB schema-less?

Yes, ArangoDB is schemaless by default. You no need to define what attributes a document can store. A collection in ArangoDB has multiple documents, where each document can follow same schema (or) can have different structure from other document.

 

Can I enforce validation on document content structure?

As I said, ArangoDB is schema-less by default. But if you want to enforce fixed structure on documents, you can do it at collection level.

 

Types of collection

There are two types of collections supported in ArangoDB.

a.   Document collection or vertex collection

b.   Edge collection

 

Two documents stored in a document collection are linked by a document in edge collection. Document is edge collection has two special attributes _from, _to which is used to create relation between documents.

 

 

 

Previous                                                    Next                                                    Home

No comments:

Post a Comment