Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions doctests/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 5 additions & 6 deletions doctests/query-em.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,12 @@ await client.ft.create('idx:email', {

await client.json.set('key:1', '$', { email: 'test@redis.com' });

try {
const res6 = await client.ft.search('idx:email', 'test@redis.com', { DIALECT: 2 });
console.log(res6);
} catch (err) {
console.log("'test@redis.com' syntax not yet supported.");
}
// Escape special characters (. and @) in the email address for TAG field search
const emailAddress = 'test@redis.com'.replace(/[.@\\]/g, '\\$&');
const res6 = await client.ft.search('idx:email', `@email:{${emailAddress}}`);
console.log(res6.total); // >>> 1
// REMOVE_START
assert.strictEqual(res6.total, 1);
await client.ft.dropIndex('idx:email', { DD: true });
// REMOVE_END
// STEP_END
Expand Down
Loading