coen-hyde / Shanty-Mongo

Shanty Mongo is a mongodb library for the Zend Framework. Its intention is to make working with mongodb documents as natural and as simple as possible. In particular allowing embedded documents to also have custom document classes.
Other
200 stars 52 forks source link

Mass update #115

Open Casebash opened 11 years ago

Casebash commented 11 years ago

In SQL you can write:

"UPDATE table_name SET column1=value1,column2=value2,... WHERE some_column=some_value;"

Does Shanty-Mongo have an equivalent function - or do I have to update the modules one by one?

ZeusMode commented 11 years ago

I guess you're looking for $set property.

$userData = array( '$set'=> array( 'first_name' => 'Name', 'last_name' => 'Last name', ) ); $users->update(array('user_id' =>$USER_ID), $userData);

regards