Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing a subdocument gives an error #1278

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

Removing a subdocument gives an error #1278

switzer opened this issue Jan 9, 2013 · 1 comment

Comments

@switzer
Copy link

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
@aheckmann
Copy link
Collaborator

fixed in the 3.6x branch

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants