Details
-
Improvement
-
Resolution: Done
-
Trivial - P5
-
None
-
None
-
None
Description
According to https://jira.mongodb.org/browse/SERVER-17853 , you can't create a partial index with `$exists: false` as a filter:
> db.test.createIndex({ test: 1 }, { partialFilterExpression: { discarded: { $exists: false } } });
|
{
|
"ok" : 0,
|
"errmsg" : "unsupported expression in partial index: $not\n discarded exists\n",
|
"code" : 67
|
}
|
However, https://docs.mongodb.org/manual/core/index-partial/#restrictions does not list this restriction, or any of the restrictions on which operators you can use for partial indexes for that matter.