Skip to content
This repository was archived by the owner on Apr 15, 2023. It is now read-only.

Error key xxx.$.yyy must not contain '.' while updating an array element #64

@marcolino

Description

@marcolino

I'm using "mongoose-history": "^0.8.0".

If I do something like:

...

// plugins
schemaPeople.plugin(mongooseHistory, {
  customCollectionName: name + "History",
  indexes: [{ 't': -1, 'd._id': 1 }],
}); // add support for history of changes

...

People.updateOne(
    { id: personId, "images": { "$elemMatch": { "url": imageDownloaded.url } } },
    { $set: { "images.$.etag": imageDownloaded.etag } },
    function(err, result) {
      if (err) {
        console.error('error:', err);
      } else {
        console.log('success:', result);
      }
      dbClose();
    }
  );

I get the error:

key images.$.etag must not contain '.'

Without the mongooseHistory plugin I have no issue.

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