Skip to content

Increate the count only when creation success. #99

@cwang1221

Description

@cwang1221

Dear Experts,

I found the count is increased no matter if the creation of the document success or not. E.g.

  1. I create a new user, the count will be 1
  2. I try to create the second user, but since I give a duplicate key to it, the creation failed (err.name === "MongoError" && err.code === 11000)
  3. I create a new user, the count is 3, but actually it should be 2.

Any idea on this? Thank you so much!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions