When trying collection with test.collection.col
name returns empty array:
db.collection('collection.col', {w: 1, strict: true}, function (err, collection) {
if (err) {
console.log(err); // Collection collection.col does not exist. Currently in strict mode.
}
});
But with {strict: false}
the collection.col
collection gets successfully.
P.S: I'm just noticed that this happens when collection name has name like path.path
and doesn't happens in case path
. So the following code works well:
db.collection('collection', {w: 1, strict: true}, function (err, collection) {
if (err) {
console.log(err); // null
}
});