Increment key based on another field
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)
with this plugin currently not possible (increment value based on other value)
Any update on this?
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?