Skip to content

Commit

Permalink
Query LiteDb transform query to work in v5
Browse files Browse the repository at this point in the history
  • Loading branch information
psavva committed Mar 17, 2024
1 parent c7669d8 commit 16183d5
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ public List<string> GetAddressesHigherThanHeight(int height)
this.SaveAllItems();

// Need to specify index name explicitly so that it gets used for the query.
IEnumerable<AddressIndexerData> affectedAddresses = this.addressIndexerDataCollection.Find(Query.GT("BalanceChangedHeightIndex", height));
// Query to find documents where any BalanceChangedHeight in the BalanceChanges array is greater than 'height'
IEnumerable<AddressIndexerData> affectedAddresses = this.addressIndexerDataCollection.Find(Query.GT("$.BalanceChanges[*].BalanceChangedHeight ANY", height)).ToList();

// Per LiteDb documentation:
// "Returning an IEnumerable your code still connected to datafile.
Expand Down

0 comments on commit 16183d5

Please sign in to comment.