-
Notifications
You must be signed in to change notification settings - Fork 42
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
Error With Status of 0 #31
Comments
That isn't good, I'll write a test and try to get to the bottom of it. Thanks for the info! |
I believe that is happening because the validation happens within mongo, not mongoose where most validation happens. However, I can not seem to reproduce the error.... be great if you could share part of a schema that this happens with. |
I think you are exactly right. I ran across this when I changed the name of an indexed unique field in my mongoose schema. So I had the first schema and then I changed it to the second listed below. When I went to insert a new record using the new schema, it would fail because Mongo was still looking for a "Name" index in addition to the newly created "usertype_name" index, but I was only sending the required "usertype_name" field and "Name" wasn't being sent and consequently wasn't satisfying the mongo rules. Original:var UserTypeSchema = new Schema({
Name: {type: String, index: { unique: true } },
Description: {type: String }
}); Modified:var UserTypeSchema = new Schema({
usertype_name: {type: String, index: { unique: true } },
usertype_description: {type: String }
}); |
Hello,
I am not sure what is causing this, but I have always used the status property of the Object returned from MERS to determine whether an error has occurred. I am getting an error from MongoDB about a duplicate id, (I know the this error isn't a MERS issues), but I was surprised when the object comes back from MERS with an "error" property and the status was 0. I was just curious if you had any insight into this, I know I am probably missing something obvious, but I am losing track of the code during this snippet from route.js
Thanks for any insight you may be able to provide
The text was updated successfully, but these errors were encountered: