These are chat archives for reactioncommerce/reaction

Jul 2015
Vlatko Koudela
Jul 03 2015 14:33

Hi @aaronjudd, I'm running one clean RC instance on Digital Ocean's server and I'm getting

Exception while invoking method 'addressBookAdd' MongoError: Field name duplication not allowed with modifiers

This happens when I try to submit my address on checkout page. There is no open session in that moment. OS: Ubuntu Server 14.04 with standard MongoDB that comes with apt-get. Did you or anyone else get any similar exception? Btw, there is no error when working on localhost.

Aaron Judd
Jul 03 2015 18:25
@vkoudela I haven’t seen that. have multiple tests with remote db, so don’t think that’s it
Vlatko Koudela
Jul 03 2015 18:44
@aaronjudd I’m not sure either because I tried few scenarios, so even if I take out that line somewhere else and try, it fails, but calling upsert() on my custom collection works as expected. Since I haven’t found any logical cause for that, replacing upsert() with the following code works okay
    ReactionCore.Collections.Accounts.update accountId, { $addToSet: "profile.addressBook": doc }, {}, (err, affectedRecords) ->
      if !err and affectedRecords == 0
          _id: accountId
          profile: addressBook: [ doc ]