redis / redis-om-node

Object mapping, and more, for Redis and Node.js. Written in TypeScript.
MIT License
1.18k stars 80 forks source link

Is the README out of date? #160

Closed vsarang closed 1 year ago

vsarang commented 1 year ago

Trying to set redis up today but I've immediately been getting strange errors even though I'm following the README to a tee:

import { EntityId } from 'redis-om'
'"redis-om"' has no exported member named 'EntityId'. Did you mean 'Entity'? (FixIt)

And another one:

import { Repository } from 'redis-om'

const albumRepository = new Repository(albumSchema, redis)
Cannot create an instance of an abstract class.

Version:

redis-om@^0.3.6:
   version "0.3.6"
   resolved "https://registry.yarnpkg.com/redis-om/-/redis-om-0.3.6.tgz#5c2d9e57a614e2ae9c21b8ab1d22baa0b7c63fa6"
   integrity sha512-WRmrAm1n1EQIQbEwbfqpceuxHgr7LKOZ471c/KGxyOTVFFm53E0S7vFSZA7a1Jnga7aHTOYqLhhMWE0lKKdsNw==
   dependencies:
     redis "^4.0.4"
     ulid "^2.3.0"
vsarang commented 1 year ago

The answer seems to be: Yes, the README is out of date.

I had much more luck following this guide to get set up and familiarized with the library: https://redis.io/docs/stack/get-started/tutorials/stack-node/#entity-schema-and-repository

You guys might want to update the README here, or at least add a disclaimer to the top because I'm sure there are other devs out there like me who burned a few hours chasing down dead ends due to bad docs. Not the best first experience with Redis!

guyroyse commented 1 year ago

The README is in agreement with the current beta version for Redis OM for Node.js which I would heartily encourage you to check out.

vsarang commented 1 year ago

How do I get the beta version?

I simply followed the instructions in the README:

npm install redis-om

This gave me redis-om@^0.3.6 which was throwing the errors I listed above when I tried to continue following the README instructions.

guyroyse commented 1 year ago

npm install ***@***.***

Sent from Proton Mail for iOS

On Thu, Mar 16, 2023 at 5:06 PM, Vik Sarang @.***> wrote:

How do I get the beta version?

I simply followed the instructions in the README:

npm install redis-om

This gave me redis-om@^0.3.6 which was throwing the errors I listed above when I tried to continue following the README instructions.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

vsarang commented 1 year ago

So any hint on which version I'm supposed to install to get the "beta" version? Again, it's not listed anywhere in the README...

Maybe here? https://github.com/redis/redis-om-node/tags

Am I supposed to install v0.2.0 to get the beta? It just seems like an older version of what I have (v0.3.6), so it's not clear.

Forgive me if I'm coming across as an idiot -- I'm really trying here dude! But it is kinda hard because there is no documentation on any of this.

guyroyse commented 1 year ago

Sorry. My phone decided to star out what I guess it thought was an email address.

Just do npm install redis-om@beta.

vsarang commented 1 year ago

Ah got it, thank you!

I opened a PR here to just include this tidbit in the README: https://github.com/redis/redis-om-node/pull/161

I'm happy to address feedback if you want it done in a different way, but I just want to put something in there because I lost half a day debugging/rewriting this for our project which I think could've been saved with some documentation.