Skip to content

Commit

Permalink
adding some docs for stuff that has come up (#467)
Browse files Browse the repository at this point in the history
  • Loading branch information
slorello89 committed Jul 19, 2024
1 parent 6d445a5 commit 4890559
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<Customer>(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.

0 comments on commit 4890559

Please sign in to comment.