Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9117763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:58:23+00:00 2026-06-17T04:58:23+00:00

I want to render a reactive template based on this document: Sprint: WorkStories: Tasks

  • 0

I want to render a reactive template based on this document:

Sprint: 
    WorkStories:
        Tasks

I know this can be done by making a Meteor collection for each “level,” but that means the result is actually being stored as a seperate document in the database. I want to know if its possible to have one collection/document for Sprint, that has standard collection of WorkStories with a standard collection of Tasks each, rendered to a reactive template.

I’ve seen [Meteor.deps.Context][1], but I can’t figure out how to wire it up (or even if it’s the right tool), and none of the examples do anything like this.

I’ve also seen [this question][2], but he seems to be asking about connecting related-but-separate documents, not rendering a single document.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T04:58:24+00:00Added an answer on June 17, 2026 at 4:58 am

    Because database queries on collections are already reactive variables on the client, the below will render one Sprint document with nested WorkStories that has nested Tasks in a template:

    HTML:

    <head>
        <title>Sprints Example</title>
    </head>
    
    <body>
        {{> sprints }}
    </body>
    
    <template name="sprints">
      {{#each items}}
        <div>Name: {{name}}</div>
            {{#each this.WorkStories}}
                <div>{{name}}</div>
                {{#each this.Tasks}}
                    <div>{{name}}</div>
                {{/each}}
            {{/each}}
      {{/each}}
    </template>
    

    Javascript:

    Sprints = new Meteor.Collection("sprints");
    
    if (Meteor.isClient) {
        Template.sprints.items = function () {
          return Sprints.find({});
      };
    }
    
    if (Meteor.isServer) {
        Meteor.startup(function () {
            if (Sprints.find().count() === 0) {
                Sprints.insert({ name: 'sprint1', WorkStories: [{ name: 'workStory1', Tasks: [{ name: 'task1' }, { name: 'task2' }, { name: 'task3' }] }, { name: 'workStory2', Tasks: [{ name: 'task1' }, { name: 'task2' }, { name: 'task3' }] }] });
            }
      });
    }
    

    UPDATE WITH ANSWER

    Per @Paul-Young’s comment below, the problem with my usage of $set was the lack of quotes in the update. Once the nested object renders in the Template, as of Meteor 0.5.3 you can update sub arrays simply:

    Sprints.update(Sprints.findOne()._id, { $set: { "WorkStories.0.name": "updated_name1" } });
    

    BACKGROUND INFO

    This does load the initial object, but updating seems problematic. I was able to get the Template to rerender by calling the below in the console:

    Sprints.update(Sprints.findOne()._id, { name: 'sprint777', WorkStories: [{ name: 'workStory1232', Tasks: [{ name: 'task221' }, { name: 'task2' }, { name: 'task3' }] }, { name: 'workStory2', Tasks: [{ name: 'task1' }, { name: 'task2' }, { name: 'task3' }] }] })
    

    Which follows these rules, per the Meteor Docs:

    But if a modifier doesn’t contain any $-operators, then it is instead interpreted as a literal document, and completely replaces whatever was previously in the database. (Literal document modifiers are not currently supported by validated updates.

    Of course, what you want is to use the $set style operators on nested documents and get the templates to re-render when their nested properties change without having to replace the entire document in the table. The 0.5.3 version of Meteor included the ability to search for sub-arrays:

    Allow querying specific array elements (foo.1.bar).

    I’ve tried to do the . sub array search and haven’t been able to update the WorkStories subdocument of the original entity yet, so I posted a question in the google talk.

    Hope this helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to render same template on one page which should display the value
Well I want to render a self closing tag say <img> tag like this
Following problem: I want to render a news stream of short messages based on
Background: I want to render this: <a href=javascript:myfunction('Somevar')><img src=some.png width=20 height=20 border=0 /></a> in
I want to render this list in a single line. List item1 List item2
I want to render blocks of HTML in alternate orientations. Is this the correct
I want to render in a template an image that originates from a ClientBundle.
I want to render something like this in firefox <div style=float:left> Row1,Column1 </div> <div>
I want to render a handlebars script inside a div . This used to
i want to render to my template 2 things at the same time like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.