Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

step是否可以优化为:配置一个list,每次自增时随机选择步长 #8

Open
zj8487 opened this issue Jun 26, 2014 · 3 comments

Comments

@zj8487
Copy link

zj8487 commented Jun 26, 2014

No description provided.

@mariodu
Copy link
Owner

mariodu commented Oct 27, 2014

不好意思啊,没想到会有这么多人会用,最近抽时间看一下。

@zj8487
Copy link
Author

zj8487 commented Dec 14, 2014

多谢,如果step唯一,别人就知道你下一个id是多少,有些时候,我们需要一些随机性。
所以step是否能够配置成一个Array, 每次生成下一个id的使用的步长在这个数组中随机选择。
比如如下配置
UserSchema.plugin(autoinc.plugin, { model: 'User', field: 'seqnumber', start: 100, step: [1,4,5,7, 10] });

@snowdream
Copy link

不错的工程,这个需求也很好,希望能够得到加强。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants