Skip to content
  • Grzegorz Szwarc's avatar
    cac4bd9b
    Bug #30843865: INCONSISTENT CONSTRAINT VIOLATION ERRORS WITH UPSERT · cac4bd9b
    Grzegorz Szwarc authored
    
    
    As a user, when a collection contains the following documents:
    
    [{ '_id: '1', name: 'foo' }, { _id: '2', name: 'bar' }]
    
    and there's a unique key constraint for the "name" property. I expect
    that, when trying to insert or upsert a document where the value of
    "name" is already being used by an existing document in the collection,
    the X Plugin will send back the same kind of error reporting the fact
    that the constraint was violated.
    
    However, currently, this is not the case, and the X Plugin is sending
    back a different error, which does not contain any kind of context for
    the case when an upsert actually translates to an insert and not an
    update. Not sure if this is the expected behavior or not but it looks
    like an inconsistency and the fact that the error does not tell the user
    what actually went wrong makes it even worse.
    
    
    RB: 23929
    Reviewed-by: default avatarLukasz Kotula <lukasz.kotula@oracle.com>
    cac4bd9b
    Bug #30843865: INCONSISTENT CONSTRAINT VIOLATION ERRORS WITH UPSERT
    Grzegorz Szwarc authored
    
    
    As a user, when a collection contains the following documents:
    
    [{ '_id: '1', name: 'foo' }, { _id: '2', name: 'bar' }]
    
    and there's a unique key constraint for the "name" property. I expect
    that, when trying to insert or upsert a document where the value of
    "name" is already being used by an existing document in the collection,
    the X Plugin will send back the same kind of error reporting the fact
    that the constraint was violated.
    
    However, currently, this is not the case, and the X Plugin is sending
    back a different error, which does not contain any kind of context for
    the case when an upsert actually translates to an insert and not an
    update. Not sure if this is the expected behavior or not but it looks
    like an inconsistency and the fact that the error does not tell the user
    what actually went wrong makes it even worse.
    
    
    RB: 23929
    Reviewed-by: default avatarLukasz Kotula <lukasz.kotula@oracle.com>
Loading