neilwatson has asked for the wisdom of the Perl Monks concerning the following question:
Hello,
I'm trying to use the Perl MongoDb module to extract a list from mongo, alter the data and replace the original list. The replace operation has gone wrong. I have tried this code:
$col->update( { "host" => $host }, { '$set' => { "timestamp" => [ @new ] } }, { 'multiple' => 1, 'safe' => 1 } ) || die "$!";
This does not seem to work as the list is emptied by the update. What have I done wrong?
Neil Watson
watson-wilson.ca
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: MongoDB replacing an array
by Khen1950fx (Canon) on Aug 26, 2012 at 03:17 UTC | |
by neilwatson (Priest) on Aug 26, 2012 at 13:13 UTC | |
by Mr. Muskrat (Canon) on Aug 27, 2012 at 18:42 UTC | |
by chchow (Initiate) on May 16, 2014 at 05:43 UTC | |
Re: MongoDB replacing an array
by Mr. Muskrat (Canon) on Aug 26, 2012 at 17:38 UTC | |
by neilwatson (Priest) on Aug 26, 2012 at 17:43 UTC | |
by Mr. Muskrat (Canon) on Aug 26, 2012 at 18:07 UTC | |
by neilwatson (Priest) on Aug 26, 2012 at 18:10 UTC | |
by Mr. Muskrat (Canon) on Aug 26, 2012 at 18:39 UTC | |
|
Back to
Seekers of Perl Wisdom