node.js - Iterate Mongoose Properties in Jade -
I am trying to produce a list of properties from a Mongoose object, but I also get very Javascript Helper functions I'm thinking that there is a clear way to output only my mouth schema properties.
My Z display code looks like this:
h4 legacy data ul - every val key, D.old li = key + ":" + val and my strange schema definition
entry = new schema ({old: {depositor: string, table: string, verged: number}}); But when the page is provided, a bunch of other JavaScript properties and functions are output at the same time. E.g.
_scope: [object] toObject: function () {return.get (path); } Wordid: 2035 ... Is there an easy way to repeat through my schema through properties? I can use a specific list, but I was thinking that there is a good way.
Actually, how would I write in the specified way? In Ruby I know that I can do ['wordid', 'submitter']. But what's the equivalent in Z?
You are facing prototype properties of the object. You can filter them with .hasOwnProperty - each value, key in d.od - if (d.old.hasOwnProperty (key)) = Key + ":" + Val
Comments
Post a Comment