Skip to content

Collection and index name not visible when duplicate value for a unique field is encountered #9891

@RahulLanjewar93

Description

@RahulLanjewar93

New Issue Checklist

Issue Description

Parse throws the below error if an object is created where the collection has unique index and there is conflict.

'A duplicate value for a field with unique values was provided'

Steps to reproduce

Actual Outcome

The error is meaningless because its difficult to trace back which class or the index had the conflict
can use regex to abstract the information from the error. I have removed sensitive information from the error.
E11000 duplicate key error collection: db.collectionName index: index_name_1 dup key: { field: "value", name: "voluptatem" }

Expected Outcome

We should add proper collectionName and indexName along with the error?

Environment

Server

  • Parse Server version: 7
  • Operating system: na
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): na

Database

  • System (MongoDB or Postgres): Mongo
  • Database version: na
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): Local

Client

  • SDK (iOS, Android, JavaScript, PHP, Unity, etc): js
  • SDK version: 6

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:featureNew feature or improvement of existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions