Skip to content

Updating object - Bug or WAD? #13

@stefanwalther

Description

@stefanwalther

Hi,

I am having the following situation:

  • I have an object with unknown structure (defined by an external system)
  • Let's say it looks as follows
let schema = mongoose.Schema(
    {
      name: 'string',
      size: 'string',
      infos: {
        type: Object,
        required: true,
        default: {}
      }
    }
  );
  schema.plugin(HistoryPlugin);
  let Tank = mongoose.model('tankExtended', schema);

If I now patch the model, the history is always saved, regardless infos has changed or not.

Do you consider this to be a WAD (e.g. I should use a subdocument), or should some deep-checking happening here?

Thx a lot for your answer & this great project!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions