You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
Update search-json.js (#2317)
This commit is contained in:
@@ -65,8 +65,8 @@ console.log('Users under 30 years old:');
|
|||||||
console.log(
|
console.log(
|
||||||
// https://redis.io/commands/ft.search/
|
// https://redis.io/commands/ft.search/
|
||||||
JSON.stringify(
|
JSON.stringify(
|
||||||
await client.ft.search('idx:users', '@age:[0 30]'),
|
await client.ft.search('idx:users', '@age:[0 30]'),
|
||||||
null,
|
null,
|
||||||
2
|
2
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@@ -89,11 +89,11 @@ console.log(
|
|||||||
// in the email address. This applies for other punctuation too.
|
// in the email address. This applies for other punctuation too.
|
||||||
// https://redis.io/docs/stack/search/reference/tags/#including-punctuation-in-tags
|
// https://redis.io/docs/stack/search/reference/tags/#including-punctuation-in-tags
|
||||||
console.log('Users with email "bob@somewhere.gov":');
|
console.log('Users with email "bob@somewhere.gov":');
|
||||||
const emailAddress = 'bob@somewhere.gov'.replace(/[.@]/g, '\\$&');
|
const emailAddress = 'bob@somewhere.gov'.replace(/[.@\\]/g, '\\$&');
|
||||||
console.log(
|
console.log(
|
||||||
JSON.stringify(
|
JSON.stringify(
|
||||||
await client.ft.search('idx:users', `@email:{${emailAddress}}`),
|
await client.ft.search('idx:users', `@email:{${emailAddress}}`),
|
||||||
null,
|
null,
|
||||||
2
|
2
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@@ -130,8 +130,8 @@ console.log(
|
|||||||
AS: 'totalCoins'
|
AS: 'totalCoins'
|
||||||
}]
|
}]
|
||||||
}]
|
}]
|
||||||
}),
|
}),
|
||||||
null,
|
null,
|
||||||
2
|
2
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user