Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

populating empty array hangs foreva #481

Closed
aheckmann opened this Issue · 1 comment

2 participants

@aheckmann
Owner

See comments from #477

'test populating subdocuments partially with empty array': function () {

var db = start()
  , BlogPost = db.model('RefBlogPost', posts)
  , User = db.model('RefUser', users);

User.create({
    name  : 'User 1'
  , email : 'user1@learnboost.com'
}, function (err, user1) {
  should.strictEqual(err, null);

  User.create({
      name  : 'User 2'
    , email : 'user2@learnboost.com'
  }, function (err, user2) {
    should.strictEqual(err, null);

    var post = BlogPost.create({
        title: 'Woot'
      , comments: [/*EMPTY ARRAY*/]
    }, function (err, post) {
      should.strictEqual(err, null);

      BlogPost
        .findById(post._id)
        .populate('comments._creator', ['email'])
        .run(function (err, post) {

          should.strictEqual(err, null);

          db.close();
        });
    });
  });
});
@aheckmann aheckmann closed this in 7b58bdb
@eschan

Awesome! worked like a charm. Thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.