1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-07 13:22:56 +03:00

Update search-json.js (#2317)

This commit is contained in:
Leibale Eidelman
2022-10-31 09:44:30 -04:00
committed by GitHub
parent 252c2192ea
commit 5a25078831

View File

@@ -89,7 +89,7 @@ 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}}`),