const dialogs = await Dialog.find({
$or: [
{ author: mongoose.Types.ObjectId(userID) },
{ companion: mongoose.Types.ObjectId(userID) },
],
});
No overload matches this call.
Overload 1 of 3, '(callback?: ((err: any, docs: (DialogType & Document<any>)[]) => void) | undefined): Query<(DialogType & Document<any>)[], DialogType & Document<...>>', gave the following error.
Argument of type '{ $or: ({ author: mongoose.Types.ObjectId; } | { companion: mongoose.Types.ObjectId; })[]; }' is not assignable to parameter of type '(err: any, docs: (DialogType & Document<any>)[]) => void'.
Object literal may only specify known properties, and '$or' does not exist in type '(err: any, docs: (DialogType & Document<any>)[]) => void'.
как исправить?