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

Increment key based on another field #4

Open
iamchathu opened this issue Apr 6, 2020 · 3 comments
Open

Increment key based on another field #4

iamchathu opened this issue Apr 6, 2020 · 3 comments
Labels
feature Adds a new Feature or Request info needed Extra information is needed

Comments

@iamchathu
Copy link

Let's say we have Incremented Value(ref) in the document which need to be incremented based on another field(shopId)

{
   "ref": 12,
   "shopId":1
},
{
   "ref": 13,
   "shopId":1
},
{
   "ref": 1,
   "shopId":2
},
{
   "ref": 2,
   "shopId":2
},
{
   "ref": 14,
   "shopId":1
}

What kind of approach can we have? ( the two properties are compound index)

@hasezoey
Copy link
Member

with this plugin currently not possible
(increment value based on other value)

@hasezoey hasezoey added the feature Adds a new Feature or Request label Apr 19, 2020
@tiennguyen1203
Copy link

Any update on this?

@hasezoey
Copy link
Member

like it was said earlier in the comments, it is currently not possible.

if you want it yourself, either implement it and send a PR or better explain what is necessary / wanted.

to summarize (on my understanding), you would need a external (like AutoIncrementID) tracker for the base number, but increment it by another field before applying, tracker + field = newid; or am i misunderstanding something?

@hasezoey hasezoey added the info needed Extra information is needed label Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Adds a new Feature or Request info needed Extra information is needed
Projects
None yet
Development

No branches or pull requests

3 participants