Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the MongoDB CPAN distribution.

Maintainer(s)' notes

Please don't report bugs here. Please use the MongoDB Perl driver issue tracker instead.

Report information
The Basics
Id: 56655
Status: resolved
Priority: 0/
Queue: MongoDB

People
Owner: Nobody in particular
Requestors: SAUBER [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 0.31
Fixed in: (no value)



The upsert example $pageviews->update({"url" => "www.example.com"}, {"url" => "www.example.com", '$inc' => {"views" => 1}}, {'upsert' => 1}); mentioned on http://search.cpan.org/~kristina/MongoDB/lib/MongoDB/Tutorial.pod does not work for me. The error mongod reports is: Fri Apr 16 15:46:04 update tutorial.pageview query: { url: "www.example.com" } exception userassert:Invalid modifier specifiedurl 0ms This appears to be working fine instead: $pageviews->update({"url" => "www.example.com"}, {'$inc' => {"views" => 1}}, {'upsert' => 1}); No errors are reported, and records are inserted or updated as expected. This syntax is also similar to instructions provided on http://www.mongodb.org/display/DOCS/Updating#Updating-UpsertswithModifiers - example: db.people.update( { name:"Joe" }, { $inc: { x:1, y:1 } }, true ); I'm just now starting to learn about MongoDB, so I'm not certain if I have found a real bug or if I'm misunderstanding the Tutorial.
You are correct, it was just an error in the tutorial. The fix will appear when I release 0.32. Thanks for letting me know! http://github.com/mongodb/mongo-perl- driver/commit/2455a0ff4e035e1fdb40f773b4ecc2b53c08cdd4