Error while using Raw from typeorm postgres

Asked

Viewed 15 times

0

all right?

I am having a problem in my application, I am using postgres with typeorm and when I try to use the find method with a Raw on Where, it presents the following error:

"error": "column \"mm\" does not exist"

The code I’m using in this part is as follows::

const appointments = await this.ormRepository.find({
    where: {
        date: Raw(
            dateFieldName =>
            TO_CHAR(${dateFieldName}, MM/YYYY) = '${parsedMonth}/${year}',
        ),
    },
});

Would anyone know what could be wrong?

Thanks in advance!

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.