Group Group Group Group Group Group Group Group Group

Problem with Filters: Type of expression is ambiguous without more context

Hi, Im following the book and Im trying to implement my own logic.
Im doing some queries with fluent and im having the Type of expression is ambiguos without more context error. I do import Fluent at the start of the file. Here I leave the func

func getAppointmentFiltered(_ req: Request) throws -> Future <[Appointment]> {
    return Appointment.query(on: req)
        .filter(\.appointmentCost == Appointment.appointmentStatus.sinCompletar)
        .all()
}

Thanks

@0xtim Can you please help with this when you get a chance? Thank you - much appreciated! :]

1 Like

Hi @josesantiago - what type is Appointment.appointmentStatus.sinCompletar? Does it return Future or Parent or similar, or does it match the type of appointmentCost?

Both, appointmentCost and Appointment.appointmentStatus.sinCompletar are Integers

Can you show the code for Appointment.appointmentStatus.sinCompletar because that looks like a static function?