senecajs / seneca-entity

Entity plugin for seneca
MIT License
13 stars 15 forks source link

A request to clarify a behavior related to upsert$ #71

Open lilsweetcaligula opened 3 years ago

lilsweetcaligula commented 3 years ago

I have code like this:

si.make('players')
  .data$({ id: 'MyPrecious', username: 'elvis', points: 9999 }) // => We are assuming the matching entity exists.
  .save$({ upsert$: ['username'] }, done)

Let's assume, a matching entity exists (i.e. there already exists a player with the username 'elvis'). What behavior should I expect? Now let's assume, no matching entity exists. What behavior should I expect?