MCPcopy
hub / github.com/dgraph-io/dgraph / filterUidPredicates

Function filterUidPredicates

query/query.go:2816–2830  ·  view source on GitHub ↗

filterUidPredicates takes a list of predicates and returns a list of the predicates that are of type uid or [uid].

(ctx context.Context, preds []string)

Source from the content-addressed store, hash-verified

2814// filterUidPredicates takes a list of predicates and returns a list of the predicates
2815// that are of type uid or [uid].
2816func filterUidPredicates(ctx context.Context, preds []string) ([]string, error) {
2817 schs, err := worker.GetSchemaOverNetwork(ctx, &pb.SchemaRequest{Predicates: preds})
2818 if err != nil {
2819 return nil, err
2820 }
2821
2822 filteredPreds := make([]string, 0)
2823 for _, sch := range schs {
2824 if sch.GetType() != "uid" {
2825 continue
2826 }
2827 filteredPreds = append(filteredPreds, sch.GetPredicate())
2828 }
2829 return filteredPreds, nil
2830}
2831
2832// UidsToHex converts the new UIDs to hex string.
2833func UidsToHex(m map[string]uint64) map[string]string {

Callers 1

expandSubgraphFunction · 0.85

Calls 3

GetSchemaOverNetworkFunction · 0.92
GetTypeMethod · 0.45
GetPredicateMethod · 0.45

Tested by

no test coverage detected