You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-07 13:22:56 +03:00
chore(examples): fix examples for v5 (#2938)
This commit is contained in:
committed by
GitHub
parent
bd5c230c62
commit
2c9ad2e772
@@ -1,7 +1,7 @@
|
||||
// This example demonstrates how to use RediSearch to index and query data
|
||||
// stored in Redis hashes.
|
||||
|
||||
import { createClient, SchemaFieldTypes } from 'redis';
|
||||
import { createClient, SCHEMA_FIELD_TYPE } from 'redis';
|
||||
|
||||
const client = createClient();
|
||||
|
||||
@@ -12,11 +12,11 @@ try {
|
||||
// Documentation: https://redis.io/commands/ft.create/
|
||||
await client.ft.create('idx:animals', {
|
||||
name: {
|
||||
type: SchemaFieldTypes.TEXT,
|
||||
type: SCHEMA_FIELD_TYPE.TEXT,
|
||||
SORTABLE: true
|
||||
},
|
||||
species: SchemaFieldTypes.TAG,
|
||||
age: SchemaFieldTypes.NUMERIC
|
||||
species: SCHEMA_FIELD_TYPE.TAG,
|
||||
age: SCHEMA_FIELD_TYPE.NUMERIC
|
||||
}, {
|
||||
ON: 'HASH',
|
||||
PREFIX: 'noderedis:animals'
|
||||
|
Reference in New Issue
Block a user