Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding some docs for stuff that has come up #467

Merged
merged 1 commit into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Loading