Hi ,when I use find using a regular expression ,is does work ,for the code as follows, it should return Mars and Earth ,but actually return nothing ,is there any problem?
not work
// Finding all planets whose name contain the substring 'ar' using a regular expression
db.find({ planet: /ar/ }, function (err, docs) {
// docs contains Mars and Earth
});
work
// Finding all planets in the solar system
db.find({ system: 'solar' }, function (err, docs) {
// docs is an array containing documents Mars, Earth, Jupiter
// If no document is found, docs is equal to []
});
Hi ,when I use find using a regular expression ,is does work ,for the code as follows, it should return Mars and Earth ,but actually return nothing ,is there any problem?