I am having an error that I do not understand how it happens. If I have my routes in the following order:
My controller obter_todos_precos is just a console.log and is not using any Model, but i am getting the following error:
"message": "Cast to ObjectId failed for value \"preco\" at path \"_id\" for
model \"ZonaModel\""
I have found a solution by changing the order of the routes in this way:
Why I am having this behavior?