Skip to content

Instantly share code, notes, and snippets.

@aheckmann
Created July 6, 2011 18:21
Show Gist options
  • Save aheckmann/1067945 to your computer and use it in GitHub Desktop.
Save aheckmann/1067945 to your computer and use it in GitHub Desktop.
'mixed fun': function () {
var db = start()
, Post = db.model('BlogPost', collection);
var post = new Post;
post.mixed = { x: { one: 1, two: 2 } };
post.markModified('mixed');
post.save(function (err) {
should.strictEqual(err, null);
Post.findById(post._id, function (err, post) {
should.strictEqual(err, null);
post.mixed.should.eql({ x: { one: 1, two: 2 }});
post.mixed.x.one = "one";
post.markModified('mixed');
post.save(function (err, post) {
db.close();
should.strictEqual(err, null);
post.mixed.should.eql({ x: { one: "one", two: 2 }});
});
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment