title: Change discriminator value/discriminated type in Mongoose
body: <p>I've represented a class hierarchy in Mongoose via two models and a discriminator key (simple example):
  </p>
  
  <pre><code>var options = {discriminatorKey: 'kind'};
  var UserSchema = new mongoose.Schema({
      username: {type: String, index: true},
      // some other fields
  }, options);
  
  // some  schema methods
  
  var User = mongoose.model('User', UserSchema);
  var PowerUserSchema = new mongoose.Schema({
      username: {type: String, index: true},
      // some other fields
      rank: {type: String}
  }, options);
  var PowerUser = User.discriminator('PowerUser', PowerUserSchema);
  </code></pre>
  
  <p>So far this works fine, however I ran into the situation, where I would like to "promote" a User to PowerUser. My initial idea was to set the "kind" property of a user and call save() on the instance, hoping that once the value is retrieved next time, the correct mongoose type will be returned:</p>
  
  <pre><code>var user = ... // retrieve user
  user.kind = 'PowerUser';
  user.save();
  user = ... // retrieve user again
  </code></pre>
  
  <p>This doesn't appear to work, since the "kind" value is not saved to the instance. I came across <a href="https://github.com/Automattic/mongoose/issues/3839" rel="nofollow noreferrer" title="this">this</a> suggestion, which unfortunately did not update the discriminator value either.</p>
  
  <p>My question now is: Am I even on the right track? Is updating the discriminator value even allowed for a situation like this, or should I better structure my data in a different way (e.g. use a single schema for both, with a "type" entry specifying what each instance is; this would have the effect that for the demotion case, no information is lost.)</p>
  
  <p>Additionally, pro(de)moting a user should not break all the instances in my database where (Power)Users are referenced.</p>
  
  <p>Thanks!</p>