Skip to content

Increment key based on another field #4

@iamchathu

Description

@iamchathu

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureAdds a new Feature or Requestinfo neededExtra information is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions