I am using node driver version 6 of arangodb to insert relations between two vertices as follows.
db.collection("starks").save({
_from: "Starks/Lyanna-Stark",
_to: "Starks/Ned-Stark",
type: "married"
});
This inserts relation married
between Starks/Lyanna-Stark
and Starks/Ned-Stark
into the database. But when I run this query twice, it is inserting it two times with different relation key. I want to avoid this as only one entry should be present for a single relation. How can I achieve this ?
\Packages\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\AC\MicrosoftEdge\User\Default\Favorites If you can see the duplicates for the favorites folder, then you can delete to merge the favorites together. If the favorites folders is not duplicate, then try clearing the cache and cookies of the Microsoft Edge browser and check if it helps.
If you want to edit the name of a collection, or otherwise delete it entirely, right-click on the entry in the main Collections menu. From here, click “Edit Collection” to rename it or “Delete Collection” to delete the collection entirely. If you delete an Edge collection by accident, press the “Undo” button to reverse the action.
1 Creating New Microsoft Edge Collections. The Collections feature appears as an icon in the top-right corner of the Microsoft Edge window, between the favorites and user profile icons. 2 Adding Notes and Links to an Edge Collection. ... 3 Editing or Deleting Saved Notes or Pages. ... 4 Switching Between Collections. ...
To add a link to the web page you’re currently on to a Microsoft Edge collection, click the “Add Current Page” option in the Collections feature menu. To add a note, click the New Note button to the right of the “Add Current Page” link. This will bring up a note box with formatting options.
Just create a unique index for all the relations that you are creating. For example, if the name of your relation collection is relations
, then run this query to make the combination of "_from"
, "_to"
, "type"
as unique
db.relations.ensureIndex({
type: "hash",
fields: [ "_from", "_to", "type" ],
unique: true
});
Here is the link for reference https://docs.arangodb.com/3.0/Manual/Indexing/Hash.html#ensure-uniqueness-of-relations-in-edge-collections
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With