On 08/03/13 11:26 AM, Sabine Knöfel wrote:

Yanni, you wrote
"I used the MongoDB connection directly, and wrote it to use the mongodb
UPDATE operations (because that's how all the mongodb examples did it). "

Yanni, I understand, that you have some code to perform UPDATE operations
from Smalltalk? Could you please send me some examples?

Oops, when I looked back my code, I found that I had started the project using node.js. When I was doing the mongodb UPDATE, that was still being coded in node.js. (I grew frustrated with node.js, and moved back to the comfort of Seaside).

Looking at the Mongo code in Pharo, I think you can achieve what you want by calling:

MongoCollection>>update: origDictionary with: newDictionary

Set up the 'origDictionary' to have key/value pairs for only the identifying key attributes - e.g. {'person-id' -> 'Johan'}

Set up the 'newDictionary' to have key/value pairs for only the attributes whose values need to be updated.

Warning - I've never tried this, but it looks like it should work.


Reply via email to