ArangoXEcto.Schema.incoming
You're seeing just the macro
incoming
, go back to ArangoXEcto.Schema module for more information.
Defines an incoming relationship
Behind the scenes this defines a many to many relationship so that Ecto can load the relationship using the built in functions.
The use of this function MUST be accompanied by a outgoing/3
definition in the other target node.
This will also define the __id__
field if it is not already defined so that ecto can map the relationship.
Example
defmodule MyProject.Post do
use ArangoXEcto.Schema
schema "posts" do
field :title, :string
# Will use the automatically generated edge
incoming :users, MyProject.User
# Will use the UserPosts edge
incoming :users, MyProject.User, edge: MyProject.UserPosts
end
end