Skip to content

Commit 5a25078

Browse files
authored
Update search-json.js (#2317)
1 parent 252c219 commit 5a25078

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

examples/search-json.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ console.log('Users under 30 years old:');
6565
console.log(
6666
// https://redis.io/commands/ft.search/
6767
JSON.stringify(
68-
await client.ft.search('idx:users', '@age:[0 30]'),
69-
null,
68+
await client.ft.search('idx:users', '@age:[0 30]'),
69+
null,
7070
2
7171
)
7272
);
@@ -89,11 +89,11 @@ console.log(
8989
// in the email address. This applies for other punctuation too.
9090
// https://redis.io/docs/stack/search/reference/tags/#including-punctuation-in-tags
9191
console.log('Users with email "[email protected]":');
92-
const emailAddress = '[email protected]'.replace(/[.@]/g, '\\$&');
92+
const emailAddress = '[email protected]'.replace(/[.@\\]/g, '\\$&');
9393
console.log(
9494
JSON.stringify(
95-
await client.ft.search('idx:users', `@email:{${emailAddress}}`),
96-
null,
95+
await client.ft.search('idx:users', `@email:{${emailAddress}}`),
96+
null,
9797
2
9898
)
9999
);
@@ -130,8 +130,8 @@ console.log(
130130
AS: 'totalCoins'
131131
}]
132132
}]
133-
}),
134-
null,
133+
}),
134+
null,
135135
2
136136
)
137137
);

0 commit comments

Comments
 (0)