On Jun 5, 2015, at 9:40 PM, JBD wrote:

> I have JSON object called Lodge, the start of which is like this:
> 
> [ { LodgeId: 12,
>     HasInventory: true,
>     Rooms:
>      [ { Room: { Name: { invariant: 'Queen Test' }, Id: 100, Culture: null },
>          LodgeId: 12,
>          NightlyRates: null,
>          NightlyRateErrors: null,
> 
> .... etc
> 
> As you can see, it's an array with no name.  How do I display for example the 
> LodgeId?  
> 
> I tried this but it doesn't work, displays nothing: 
> {#Lodge}{#.}{LodgeId}{/.}{/Lodge}
> 
> What am I doing wrong?  Thanks.

I don't know dust syntax, but what you have there is an array, not an object. 
To refer to the LodgeId of the object in the first array element, in 
JavaScript, you would write:

Lodge[0].LodgeId

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/EC0A6FE3-80C8-4259-A005-E31D5A353F75%40ryandesign.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to