Efficient increment of facet values

Nope, see Improve Facets mutation handling · Issue #1996 · dgraph-io/dgraph · GitHub for more details.

For increment I have an example

upsert{
  query{
    var(func: eq(campaignId, 1)){
      ts as timestamp
      incr as math(ts + 1)
    }
  }


  mutation {
    set{
         uid(campaignVar) <dgraph.type> "Campaign" .
            uid(campaignVar) <campaignId> "1" .
            uid(campaignVar) <enabled> "false" .
            uid(campaignVar) <timestamp> val(incr) . 
    }
  }
}

This approach does not work with Facets, as variables in Facets are not supported for now.

Ref

1 Like