I have used $function in my mongoose aggregation query. Can we use moment inside that $function?

65 views Asked by At

I have written mongoose aggregation query where I am using $function inside that with $add field.In that function I am converting out some dates, for that I have used moment library. But it throws me an error inside that $function like mongoose refrence error: moment is not defined. I have already declare moment at the top of my file.

How can I able to use moment into $function mongoose aggregation query.

0

There are 0 answers