From 48905599ca61ae8d291f075dde26e939e77479e4 Mon Sep 17 00:00:00 2001 From: Steve Lorello <42971704+slorello89@users.noreply.github.com> Date: Fri, 19 Jul 2024 14:32:58 -0400 Subject: [PATCH] adding some docs for stuff that has come up (#467) --- README.md | 10 ++++++++++ docs/faq.md | 2 ++ 2 files changed, 12 insertions(+) diff --git a/README.md b/README.md index a509d1e6..59e2daf8 100644 --- a/README.md +++ b/README.md @@ -159,6 +159,16 @@ Those Cities can then be queried with an `Any` predicate within the main `Where` collection.Where(c=>c.Addresses.Any(a=>a.City == "Satellite Beach")) ``` +###### Limitations + +The way Redis indexes fields within a collection of embedded objects does not allow multiple predictates to be specified to a given document e.g. + +```cs +collection.Where(c=>c.Addresses.Any(a=>a.City == "Satellite Beach" && a.ZipCode == "32937)) +``` + +In the above case the query can only check if the Addresses collection contains an entry that is `Satellite Beach`, and Contains an entry that has a zip code of `32937`, rather than an entry that has both the city of `Satellite Beach` and a zip code of `32937 + #### Cascading Index Alternatively, you can also embedded models by cascading indexes. In this instance you'd simply decorate the property with `Indexed` and set the `CascadeDepth` to whatever to however may levels you want the model to cascade for. The default is 0, so if `CascadeDepth` is not set, indexing an object will be a no-op: diff --git a/docs/faq.md b/docs/faq.md index 9a72a6cc..1dcd4c69 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -5,3 +5,5 @@ * **When the Aggregation materializes, there's nothing in the `RecordShell` object. What gives?** The `RecordShell` item is used to preserve the original index through the aggregation pipeline and should only be used for operations within the pipeline. It will never materialize when the pipeline is enumerated * **Why Do some Reductive aggregations condense down to a single number while others condense down to an IEnumerable?** When you build your pipeline, if you have a reductive aggregation not associated with a group, the aggregation is run immediately. The result of that reduction is furnished to you immediately for use. * **Is the `RedisCollection` thread safe?** - The `RedisCollection` is only thread safe when initalized with the `saveState` option set to false. e.g. `var collection = provider.RedisCollection(false);` +* **What is the difference between an `Indexed` and a `Searchable`field?** - `Indexed` should be the default for virtually all use-cases, they allow for exact matches, prefix, postfix, and infix searches on strings, as well as providing indexing for geolocations, numbers, guids, enumes and other scalar values. `Searchable` is appropriate only if you want to perform a full-text search on a given field +* **Should I set `StorageType` to `Json` or `Hash`** Generally we would recommend using `Json` if you are storing anything other than numbers and strings. \ No newline at end of file