Length of array in jade undefined
11,298
You have typo in your #{restaurant.tables.length} it should be tabels
Comments
-
Mohamad Ali almost 2 years
I have code i want to show count of tables in restaurant My code is:
#{restaurant.tables.length}
But it not works for me and error me "Cannot read property 'length' of undefined".how can i solve this?
tables is array i fetch from mongodb collection.
i use mongoosejs "findOne" method, and my restaurant schema is :
var restuarantSchema = new Schema({ name : String, details : String, owner : String, categories : { name : String }, users : [], tabels: [{ title: String }] });