You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-07 13:22:56 +03:00
fix FT.SEARCH RETURN [] (#2421)
* ref #2419 - fix FT.SEARCH RETURN [] * fix transformReply * fix PROFILE SEARCH as well * fix PROFILE SEARCH preserve * move preserve login to `pushSearchOptions` * attach preserve only if true * fix RETURN: [] test
This commit is contained in:
@@ -70,13 +70,13 @@ export function transformArguments(
|
||||
|
||||
export type SearchRawReply = Array<any>;
|
||||
|
||||
export function transformReply(reply: SearchRawReply): SearchReply {
|
||||
export function transformReply(reply: SearchRawReply, withoutDocuments: boolean): SearchReply {
|
||||
const documents = [];
|
||||
let i = 1;
|
||||
while (i < reply.length) {
|
||||
documents.push({
|
||||
id: reply[i++],
|
||||
value: documentValue(reply[i++])
|
||||
value: withoutDocuments ? Object.create(null) : documentValue(reply[i++])
|
||||
});
|
||||
}
|
||||
|
||||
@@ -88,7 +88,6 @@ export function transformReply(reply: SearchRawReply): SearchReply {
|
||||
|
||||
function documentValue(tuples: any) {
|
||||
const message = Object.create(null);
|
||||
if (tuples === undefined) return message;
|
||||
|
||||
let i = 0;
|
||||
while (i < tuples.length) {
|
||||
|
Reference in New Issue
Block a user