UNPKG

redis-orm-node

Version:

`redis-orm` is a lightweight Object-Relational Mapping (ORM) library for Node.js.

12 lines (10 loc) 406 B
import { Schema } from "../types"; export function wheresToRedisQuery(wheres: string[], schemaProperties: Schema["properties"]): string { let query: string[] = [] for (let key in schemaProperties) { const properties = wheres.filter(i => i.includes(`@${key}:`)) if (properties.length > 0) query.push(properties.join(" | ")) } return query.join(" ") }