All I can suggest is the perl equivalent of the getNextSequence function
my $filter = {'_id' => 'userid'}; my $update = { '$inc' => { 'seq' => 1} }; my $col = $db->get_collection('counters'); $col->update($filter,$update); my $id = $col->find_one($filter)->{'seq'}; print $id;
You can probably use find_one_and_update() but it didn't work on my old version 0.45 of MongoDB
pojIn reply to Re^3: MongoDB Stored procedure from Dancer2
by poj
in thread MongoDB Stored procedure from Dancer2
by actarus2003
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |