Entities retrieved with fetch() have an entityId with type string | undefined, even though fetching with an entityId that doesn't match anything in the database results in the same entityId being returned.
Code sample:
import { EntityId, Repository, Schema } from "redis-om"
import redisClient from "../services/redisClient"
const schema = new Schema("user", {
userId: { type: "string" }
})
const repository = new Repository(schema, redisClient)
const fetchUser = async (entityId: string) => {
const user = await repository.fetch(entityId)
// userEntityId has type "string | undefined"
const userEntityId = user[EntityId]
}
Entities retrieved with fetch() have an entityId with type
string | undefined
, even though fetching with an entityId that doesn't match anything in the database results in the same entityId being returned.Code sample: