Change $duplicate parameter in Database::upsert to $update