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)
| 2814 | // filterUidPredicates takes a list of predicates and returns a list of the predicates |
| 2815 | // that are of type uid or [uid]. |
| 2816 | func 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. |
| 2833 | func UidsToHex(m map[string]uint64) map[string]string { |
no test coverage detected