rethinkdb-ts icon indicating copy to clipboard operation
rethinkdb-ts copied to clipboard

ValueChange Missing Field 'error'

Open ChrisTalman opened this issue 5 years ago • 3 comments

According to the insert() documentation:

Documents in changes for which an error occurs (such as a key conflict) will have a third field, error, with an explanation of the error.

It seems that ValueChange currently lacks this in the type definitions.

The fix would seem to be very minor: simply add to ValueChange a third optional property, error.

ChrisTalman avatar Jan 31 '20 12:01 ChrisTalman

I couldn't reproduce this error field. tried listening to a table that got a conflict error and I got nothing in the "changes" feed...

ronzeidman avatar Jan 31 '20 20:01 ronzeidman

I encountered the field during my use of forEach().

To be clear, this is the changes field of an insert() result object.

ChrisTalman avatar Jan 31 '20 20:01 ChrisTalman

Found it, returnChanges should be "always" for me to see it.

ronzeidman avatar Jan 31 '20 21:01 ronzeidman