Removing a subdocument gives an error #1278

Closed
switzer opened this Issue Jan 9, 2013 · 1 comment

Comments

Projects
None yet
2 participants

switzer commented Jan 9, 2013

When I try to remove an array item in a mongoose subdocument, I get the following error:

TypeError: Cannot use 'in' operator to search for '_id' in joe@gmail.com
    at EmbeddedDocument.Document._buildDoc (/../node_modules/mongoose/lib/document.js:162:27)
    at EmbeddedDocument.Document (/../node_modules/mongoose/lib/document.js:67:20)
    at EmbeddedDocument (/../node_modules/mongoose/lib/types/embedded.js:27:12)
    at new EmbeddedDocument (/../node_modules/mongoose/lib/schema/documentarray.js:26:17)
    at MongooseDocumentArray._cast (/../node_modules/mongoose/lib/types/documentarray.js:62:10)
    at Object.map (native)
    at MongooseDocumentArray.MongooseArray.remove (/../node_modules/mongoose/lib/types/array.js:360:21)
    at model.Org.methods.removePermissions (/../models/org.js:159:20)

Here is the context:

http://stackoverflow.com/questions/14244767/trying-to-remove-a-subdocument-in-mongoose-gives-me-an-internal-mongoose-error

aheckmann added a commit that referenced this issue Jan 23, 2013

Collaborator

aheckmann commented Jan 23, 2013

fixed in the 3.6x branch

@aheckmann aheckmann closed this Jan 23, 2013

aheckmann added a commit that referenced this issue Jan 30, 2013

aheckmann added a commit that referenced this issue Feb 2, 2013

aheckmann added a commit that referenced this issue Feb 3, 2013

aheckmann added a commit that referenced this issue Mar 2, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment