-
Notifications
You must be signed in to change notification settings - Fork 86
Open
Description
Hi there,
I don't see what's wrong with this simple query.
Schema
import { Schema } from 'redis-om';
export type User = {
id: string;
gender: string;
age: number;
lastMatchAt: Date;
};
export const userSchema = new Schema(
'User',
{
id: { type: 'string' },
gender: { type: 'string' },
age: { type: 'number' },
lastMatchAt: { type: 'date', sortable: true },
},
{ dataStructure: 'HASH', indexName: 'id' },
);Query
const find = this.db.userRepository.search().where('id').is.not.equalTo(me.id);
if ([Gender.Male, Gender.Female].includes(looking.gender)) {
find.and('gender').is.equalTo(looking.gender);
}
find.and('age').is.between(looking.minAge, looking.maxAge);
return await find.returnMin('lastMatchAt'); Result
[ErrorReply: Property lastMatchAt not loaded nor in schema]
MR4online
Metadata
Metadata
Assignees
Labels
No labels