mongodb: updating elements?

wolf30

New Member
I am (as most ) coming from a mySQL background trying to switch over to noSQL and mongoDB. Since denormalization is a part of noSQL since joins is impossible, here's how I would design a simple blog:\[code\]array ( blog_title => 'my blogpost', 'date' => '2010-09-05', comments => array ( '1' => 'Such a good post!!! You deserve a nobel prize' ));\[/code\]If I want to update the comments, adding a new element in that array, how can I make sure that this is done and not the whole comments array being overwritten if multiple users are trying to write a comment at the same time?Is it the \[code\]push\[/code\] function I am looking after in mongoDB?
 
Back
Top