[DOCS-7122] Clarify that $exists: false can't be used as a partial index filter Created: 09/Feb/16  Updated: 11/Jan/17  Resolved: 09/Feb/16

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: 01112017-cleanup

Type: Improvement Priority: Trivial - P5
Reporter: Valeri Karpov Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 8 years, 1 week, 1 day ago

 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.



 Comments   
Comment by Githook User [ 09/Feb/16 ]

Author:

{u'username': u'kay-kim', u'name': u'kay', u'email': u'kay.kim@10gen.com'}

Message: DOCS-7122 include the valid operators for partialFilterExpression
Branch: master
https://github.com/mongodb/docs/commit/2006eb2bba9a82152b0e7ffcae3bf1e2cd6eeced

Generated at Thu Feb 08 07:53:38 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.