Closed anquegi closed 5 years ago
I think I understand, if my recollection is correct this is indeed currently not supported by mongoid-autoinc
. Feel free to create a pull-request, so I can have a more clear idea of what you mean, and try to include it in the gem.
Recently I discovered this gem, and I want to change my bad method of autoincrement one mongo counter to use this. So the chage it works well adding this:
The old counter is stored in reference variable; I did this:
The detections counter is a counter of the items created by a customer, so every time that I created a new object, I count mongo objects and return that number plus one.
If I change this to mongoid-autoinc, I need to seed each customer with a different value. How can I achieve that? the value should be the items created by the customer.
If I try something with the seed, the seed cannot be an anonymous function.