Skip to content

Consider supporting edge naming via value variable #4700

@MichelDiz

Description

@MichelDiz

Experience Report

What you wanted to do

Make a direct migration from Neo4J to Dgraph using the JSON structure that is exported via APOC.

What you actually did

  uid(from) <val(EDGE)> val(to) .
upsert {
  query {
      var(func: has(properties)) @filter(eq(type,"relationship") AND NOT has(migrationDone) ){
      EDGE as label
      properties {
        summary as summary
        rating as rating
        roles as  roles
      }
      start {
        ID as id
      }
      end {
        endID as id
      }
      summaryMe as sum(val(summary))
      ratingMe as sum(val(rating))
      rolesMe as sum(val(roles))
    }
    from(func: eq(id, val(ID) )) @filter(NOT eq(type,"relationship") AND NOT has(~start) AND NOT has(~end)) {
     from as uid
    }
    to(func: eq(id, val(endID) )) @filter(NOT eq(type,"relationship") AND NOT has(~start) AND NOT has(~end)) {
     to as uid
    }
  }

  mutation {
    set {
      uid(from) <migrationDone> "True" .
      uid(from) <val(EDGE)> val(to) .
       # (...)
    }
  }

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stalearea/upsertIssues related to upsert operations.dgraphIssue or PR created by an internal Dgraph contributor.exp/intermediateFixing this requires some experience with the project.kind/enhancementSomething could be better.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions