# Uniq By

Remove duplicates from an array using lodash _.uniqBy with a property path

> Canonical page: https://elysiatools.com/en/tools/uniq-by

- **Category:** Data Processing

- **Keywords:** array, unique, path, dedupe, lodash

## Overview

Remove duplicate values from an array using a property path.

**Highlights:**
- Uses lodash `_.uniqBy`
- Supports property paths (e.g. `id`, `meta.key`)
- Returns unique values as JSON

**Example:**
- Array: `[{"id": 1}, {"id": 1}, {"id": 2}]`
- Path: `id`
- Result: `[{"id": 1}, {"id": 2}]`

## Inputs

- **Array** (textarea): Enter a JSON array
- **Property Path** (text): Property path used to compare values

## When to use

- When you need to clean up API responses that contain redundant object entries.
- When processing large datasets where you must ensure unique records based on a specific ID or key.
- When you need to filter nested JSON structures by targeting specific property paths.

## How it works

- Paste your JSON array into the input field.
- Specify the property path (e.g., 'id' or 'user.email') you want to use for comparison.
- The tool processes the array using lodash _.uniqBy to identify and remove duplicates.
- Copy or download the resulting unique JSON array.

## Use cases

- Cleaning up user lists by removing duplicate entries with the same email address.
- Filtering product catalogs to ensure each item ID appears only once.
- Standardizing configuration files by stripping out redundant settings objects.

## Frequently asked questions

### What does the Property Path field do?

It tells the tool which specific key or nested path to look at when determining if two objects are duplicates.

### Can I use nested paths?

Yes, you can use dot notation (e.g., 'meta.id') to target properties nested within objects.

### What happens if I leave the Property Path empty?

If no path is provided, the tool will treat the entire object as the value for comparison.

### Is this tool case-sensitive?

Yes, the comparison follows standard JavaScript equality rules, meaning 'ID' and 'id' are treated as different values.

### Does this tool modify my original data?

No, the tool processes your input and generates a new, unique output; your original data remains unchanged.

## Related tools

- [Compact Array](https://elysiatools.com/en/tools/compact-array): Remove falsey values from array using lodash _.compact
- [Drop Items](https://elysiatools.com/en/tools/drop-items): Drop first N items from array using lodash _.drop
- [Drop Right Items](https://elysiatools.com/en/tools/drop-right-items): Drop last N items from array using lodash _.dropRight
- [Pull Values](https://elysiatools.com/en/tools/pull-values): Remove specific values from an array using lodash _.pull
- [Sorted Unique](https://elysiatools.com/en/tools/sorted-unique): Remove duplicates from a sorted array using lodash _.sortedUniq
- [Sorted Unique By](https://elysiatools.com/en/tools/sorted-unique-by): Remove duplicates from a sorted array using lodash _.sortedUniqBy
- [Uniq Array](https://elysiatools.com/en/tools/uniq-array): Remove duplicates from an array using lodash _.uniq
- [Without Values](https://elysiatools.com/en/tools/without-values): Remove specified values from an array using lodash _.without

## Samples

- [Grafana Advanced Application Samples](https://elysiatools.com/en/samples/grafana-samples): Comprehensive Grafana samples covering advanced dashboard design, alerting configurations, data source integrations, and plugin development
- [QR Code Samples](https://elysiatools.com/en/samples/qrcode-samples): Sample QR code images for testing QR code reading and generation tools
- [D3.js Data Visualization Samples](https://elysiatools.com/en/samples/d3js-data-visualization): Comprehensive D3.js data visualization examples including charts, maps, animations, and interactive visualizations
- [Rome JavaScript Toolchain Samples](https://elysiatools.com/en/samples/rome): Rome JavaScript toolchain examples including configuration, linting, formatting, bundling, and project management
