You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34Lines changed: 34 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -155,6 +155,40 @@ In this example:
155
155
- Using a cursor, we iterate over all values associated with the key "fruit" by moving to the next duplicate entry and see the values retrieved are ordered.
156
156
- Then we demonstrate doing the same thing with IEnumerable instead.
157
157
158
+
## Custom Key Ordering
159
+
160
+
LightningDB provides built-in, allocation-free comparers for custom key sorting and duplicate ordering. Use them with `CompareWith()` for keys or `FindDuplicatesWith()` for duplicate values:
|`LengthComparer`| Sort by length first, then content |
187
+
|`LengthOnlyComparer`| Sort by length only |
188
+
|`HashCodeComparer`| Hash-based comparison for large values |
189
+
190
+
Reverse variants are available for most comparers (e.g., `ReverseSignedIntegerComparer`).
191
+
158
192
## Additional Resources
159
193
160
194
For more detailed examples and advanced usage, refer to the unit tests in the [Lightning.NET](https://github.com/CoreyKaylor/Lightning.NET) repository.
0 commit comments