Skip to content

Commit

Permalink
fixing #333 doc ambiguity around migrations (#366)
Browse files Browse the repository at this point in the history
  • Loading branch information
slorello89 committed May 2, 2023
1 parent 70bce7c commit dac4774
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,12 +265,8 @@ public partial class Person

### Creating Indices

With the Index defined, the next step is to create the index. There are two methods in `IRedisConnection` we can use,
With the Index defined, the next step is to create the index. To do so use `IRedisConnection.CreateIndex(Type type)`. `CreateIndex` will create the index described by the `Type` parameter (which will be disassembled and serialized into a redis index) if and only if the Index does not already exist in Redis.

1. `IRedisConnection.CreateIndex(Type type)`
2. `IRedisConnection.MigrateIndex(Type type)`

`CreateIndex` will create the index described by the `Type` parameter (which will be disassembled and serialized into a redis index) if and only if the Index does not already exist in Redis. `MigrateIndex`, on the other hand, will look at the index already in Redis and add/remove what is needed to bring it into compliance with the prescribed index.

#### Create

Expand All @@ -279,13 +275,6 @@ var connection = RedisConnectionProvider.Connection;
connection.CreateIndex(typeof(Person));
```

#### Migrate

```csharp
var connection = RedisConnectionProvider.Connection;
connection.MigrateIndex(typeof(Person));
```

## Querying

Redis Developer Dotnet provides a Fluent API to build queries. The RedisCollection is an extension of `IQueryable` so you can apply typical lambda expressions you'd expect to use elsewhere. Only when you enumerate the collection is the query built and executed against redis.
Expand Down

0 comments on commit dac4774

Please sign in to comment.