|
According to the comment in list_collections_no_view.js which got added in SERVER-25942, when listCollections doesn't need to return a view, it should validate it. But it looks like it if we change the filter from this
{
|
"$or": [
|
{
|
"type": "collection"
|
},
|
{
|
"type": {
|
$exists: false
|
}
|
}
|
]
|
}
|
to this,
{
|
"$and" : [
|
{
|
"name" : {
|
"$ne" : "system.profile"
|
}
|
},
|
{
|
"$or" : [
|
{
|
"type" : "collection"
|
},
|
{
|
"type" : {
|
"$exists" : false
|
}
|
}
|
]
|
}
|
]
|
}
|
}
|
the listCollection command would fail with the error below:
{
|
"ok" : 0,
|
"errmsg" : "Invalid view definition detected in the view catalog. Remove the invalid view manually to prevent disallowing any further usage of the view catalog.",
|
"code" : 182,
|
"codeName" : "InvalidViewDefinition"
|
}
|
|