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

How can we make the key auto incremented ? #9

Open
KiranUppunda opened this issue Nov 24, 2020 · 3 comments
Open

How can we make the key auto incremented ? #9

KiranUppunda opened this issue Nov 24, 2020 · 3 comments

Comments

@KiranUppunda
Copy link

Is it possible to make the key auto incremented on each insert ?

@CynthiaBlue
Copy link

I was just going to ask this exact same question!

1 similar comment
@BL2011
Copy link

BL2011 commented Oct 26, 2021

I was just going to ask this exact same question!

@Rednas83
Copy link

I have a requirement for this too.

As a workaround you can do:

if (!key) key=String(await this.$db.collection(table).get().length)
await this.$db.collection(table).add(iValue, key)

Possible solution
await this.$db.collection(table).add(value) // Automaticly incrementing the key starting from 0 (replacing the generated key)
resulting in
image
instead of
image

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

4 participants