Skip to content
This repository has been 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

Open
marcolino opened this issue Jan 1, 2021 · 1 comment

Comments

@marcolino
Copy link

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.

@KakitLee
Copy link

Same, it looks like it does not support nested schema.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants