Update idGenerator.js#getNextIdFromDb

Update getNextIdFromDb method in initializers/idGenerator.js.