Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
0.9.4
-
None
Description
UPSERT doesn't work right for datasets with auto-generated (UUID) keys. Both UPSERT and INSERT blindly generate and add the key - and if the incoming record already has a key value, they fail with an object-merge error (note that we need to improve the msg too!) due to what then becomes a duplicate field. What's needed is to get them both to do to the right thing - which would be to use the incoming key value if there is one and only generate one only if there isn't one in the incoming object. This is especially a problem for UPSERTs, as it means we currently cannot ever update data in datasets with system-generated keys (!!!). (For INSERT we could just make a rule that you can't pass in a key if you're going into auto-keyed dataset.) This is a major bummer for open-source users who want to use UUIDs.