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

Malformed queries don't throw errors #1698

Closed
brandoncarl opened this issue Sep 15, 2013 · 0 comments
Closed

Malformed queries don't throw errors #1698

brandoncarl opened this issue Sep 15, 2013 · 0 comments
Labels
confirmed-bug We've confirmed this is a bug in Mongoose and will fix it.
Milestone

Comments

@brandoncarl
Copy link

Not sure if this is intentional behavior, but I wanted to alert you all to it. I think it would make most sense to match MongoDB's errors.

The query is intentionally malformed.

var Sample  = mongoose.model('Sample', { text : String, val : Number });

var sample = new Sample({ text : "Hello", val : 100 });
sample.save(function(err) { if (err) console.log(err); });

Sample.find(45, function(err, results) {
  console.log(err);      // should throw error (MongoDB does)
  console.log(results);  // should be null. currently returns all
});
@vkarpov15 vkarpov15 added this to the 4.13.6 milestone Dec 1, 2017
@vkarpov15 vkarpov15 added confirmed-bug We've confirmed this is a bug in Mongoose and will fix it. and removed enhancement This issue is a user-facing general improvement that doesn't fix a bug or add a new feature labels Dec 1, 2017
vkarpov15 added a commit that referenced this issue Dec 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed-bug We've confirmed this is a bug in Mongoose and will fix it.
Projects
None yet
Development

No branches or pull requests

2 participants