1
0
mirror of https://github.com/redis/node-redis.git synced 2025-07-31 05:44:24 +03:00

docs(search): update SchemaFieldTypes to SCHEMA_FIELD_TYPE for redis@5.x (#2992)

This commit is contained in:
Navi sureka
2025-06-06 12:00:07 +05:30
committed by GitHub
parent 2bb515e489
commit 21d8f0e957

View File

@ -19,11 +19,11 @@ Before we can perform any searches, we need to tell RediSearch how to index our
```javascript
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'
@ -91,15 +91,15 @@ One way we might choose to index these documents is as follows:
```javascript
await client.ft.create('idx:users', {
'$.name': {
type: SchemaFieldTypes.TEXT,
type: SCHEMA_FIELD_TYPE.TEXT,
SORTABLE: 'UNF'
},
'$.age': {
type: SchemaFieldTypes.NUMERIC,
type: SCHEMA_FIELD_TYPE.NUMERIC,
AS: 'age'
},
'$.coins': {
type: SchemaFieldTypes.NUMERIC,
type: SCHEMA_FIELD_TYPE.NUMERIC,
AS: 'coins'
}
}, {