Do you want to request a feature or report a bug?
Bug
What is the current behavior? What is the expected behavior?
If the current behavior is a bug, please provide the steps to reproduce.
.findOne({ email : "[email protected]"})
.exec( (err, doc) => {
if(err) console.log(err);
console.log(doc);
})
With [email protected] : finds and logs the document (expected behavior)
With [email protected] : returns and logs null, no error (current behavior)
Please mention your node.js, mongoose and MongoDB version.
Node : v8.2.1
MongoDB : 3.4.6
Similarly, the following code used to return all items in the collection in 4.x, but with 5.0.0rc1 returns nothing:
model.find((err, docs) => {
if(err) { return err; }
return docs;
}
This might be merely an issue of me not being familiar with new syntax in 5.0, but the docs seem to still be for 4.x so I'm unsure what the trouble is.
Node 8.9.1
MongoDB 3.4.4
I think this is related to #5958, try upgrading to 5.0.0-rc1. I don't think OP was using 5.0.0-rc1 because it wasn't released until 2018-01-02T15:59:12.408Z, whereas OP posted approximately 2018-01-02T14:34:00.000Z
@cwbuecheler what makes you think the docs are for 4.x?
@vkarpov15 - principally the big yellow box at the top talking about migrating from 3.x to 4.x, but also a general expectation that the docs wouldn't be updated for a release candidate, but rather that whoever maintains them would wait for the actual release. I admit I didn't do a ton of checking to see if they'd been updated for 5.x or not. Just made a quick assumption.
For the record, I'm talking about the docs at mongoosejs.com ... unsure if there are others available.
Yeah we need to update the yellow box, among other things. We'll also add 4.x docs shortly
I don't think OP was using 5.0.0-rc1
Yes, it's a typo. In the title it's correct (RC0), I fixed it, thanks
I'm going to close this for now because I don't see any evidence this wasn't fixed in 5.0.0-rc1. Will fix the yellow box too
For the record, I just tested with RC2, and the issue I mentioned above has been fixed. Thanks!
Most helpful comment
For the record, I just tested with RC2, and the issue I mentioned above has been fixed. Thanks!