Hi, no, the `_key` attribute can't be changed. However, you can add indices to any attributes of your documents to ensure the uniqueness: https://docs.arangodb.com/3.2/Manual/Indexing/IndexBasics.html#hash-index If you want to use only one attribute as the primary key, you will have to rename your `id` attribute to `_key` - maybe in the serialization code?
Regarding graphs, as explained at https://docs.arangodb.com/3.2/Manual/Graphs/ - vertices are referenced by their `_key` - via the `_to` and `_from` attributes in edge collections. However, ArangoDB gives you lots of freedom how these documents look for the rest, and how they're related to documents in other collections. Cheers, Willi On Wednesday, September 20, 2017 at 1:49:43 PM UTC+2, Victor Caballero wrote: > > Hello, > > I am new to arangodb and I've come up with two questions. > > The first one is if it is possible to change the "_key" attribute name. I > mean, my model has objects with an id attribute, which I would like to > expose as a JSON abject with the attribute "id". I have made serializers > for that purpose, which, in fact, have an "id" key. The problem is that > when it comes to saving the object to the arangodb, it ends having to > unique identifiers, namely "id" and "_key". Is it possible to rename or > delete the "_key" attribute for all obejcts? > > The second question that is maybe related to the first one is about > arangodb data models (document model an graph model). Is it possible to > have a mix of models where a document has a named relationship to another > document in a different collection. As far as I have investigated, it is > possible but, does the vertex id have to be in the "_key" attribute? > > Thanks, > > Víctor > -- You received this message because you are subscribed to the Google Groups "ArangoDB" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
