in reply to Re^2: MongoDB Stored procedure from Dancer2
in thread MongoDB Stored procedure from Dancer2
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
poj
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: MongoDB Stored procedure from Dancer2
by actarus2003 (Novice) on Mar 29, 2017 at 10:21 UTC | |
by actarus2003 (Novice) on Nov 06, 2017 at 16:39 UTC |