Skip to content

Commit d05fde3

Browse files
authored
Update stack-node.md
#227
1 parent 70bb263 commit d05fde3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/stack/clients/om-clients/stack-node.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,11 @@ A `text` field is a lot like a `string`. If you're just reading and writing obje
172172

173173
### Repository
174174

175-
Now we have all the pieces that we need to create a **repository**. A `Repository` is the main interface into Redis OM. It gives us the methods to read, write, and remove a specific `Entity`. Create a `Repository` in `person.js` and make sure it's exported as you'll need it when we start implementing out API:
175+
Now we have all the pieces that we need to create a **repository**. A `Repository` is the main interface into Redis OM. It gives us the methods to read, write, and remove a specific `Entity`. Fetch a `Repository` in `person.js` using `fetchRepository` and make sure it's exported as you'll need it when we start implementing out API:
176176

177177
{{< highlight javascript >}}
178178
/* use the client to create a Repository just for Persons */
179-
export const personRepository = new Repository(personSchema, client)
179+
export const personRepository = client.fetchRepository(personSchema)
180180
{{< / highlight >}}
181181

182182
We're almost done with setting up our repository. But we still need to create an index or we won't be able to search. We do that by calling `.createIndex()`. If an index already exists and it's identical, this function won't do anything. If it's different, it'll drop it and create a new one. Add a call to `.createIndex()` to `person.js`:

0 commit comments

Comments
 (0)