-
Notifications
You must be signed in to change notification settings - Fork 96
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
Mongoose ObjectId not be recognised as _id in create #232
Comments
Please share a repository that reproduces your issue. I don't see |
Thank you so much, I've transferred it from bitbucket to GitHub, hopefully, sooner or later I can give back to the community |
Do you have any other changes you made? The repository just looks like a unmodified generated application. |
@daffl Sorry I forgot to push the verify phone branch up, it is now there. |
I've managed to work around it, the error was being caused by an index that I must have previously created and attached to the collection. I solved the issue by dropping the collection completely and then restarting it. The error I was getting was the same as the one mentioned in this post Automattic/mongoose#2471 . Thank you very much though @daffle and sorry to have been a pain. |
👍 Glad you figured it out. |
@daffl I've been slightly spamming slack and I really apologise for that.
I've commented on another issue but thought I should open another one in case people have the same problem in the future
I am currently able to create one MongoDB user, along with an _id of type ObjectId,
I am able to authenticate my user and use that authentication to fetch the list of users, this is a user object.
{` "total": 1, "limit": 10, "skip": 0, "data": [ { "_id": "5a9a8c3e4b0aac22847635fe", "updatedAt": "2018-03-03T11:51:26.171Z", "createdAt": "2018-03-03T11:51:26.171Z", "email": "test@test.com", "__v": 0 } ] `}
What i am not able to do is create a new user as each time I try I get an error code of 409 with the following response
{ "name": "Conflict", "message": "id: null already exists.", "code": 409, "className": "conflict", "errors": { "id": null } }
I am really sorry for sending so many messages on this, I just really want and need to get my head around what is going on. Thank you very much for providing any insight
The text was updated successfully, but these errors were encountered: