[DOCS-14794] [SERVER] improvement required for the " $exists " documentation Created: 14/Sep/21 Updated: 30/Oct/23 Resolved: 09/Nov/21 |
|
| Status: | Closed |
| Project: | Documentation |
| Component/s: | manual, Server |
| Affects Version/s: | None |
| Fix Version/s: | Server_Docs_20231030 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Dror Mikdash (Inactive) | Assignee: | Jason Price |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: | |
| Days since reply: | 2 years, 13 weeks, 1 day ago |
| Epic Link: | DOCSP-11702 |
| Story Points: | 3 |
| Description |
|
The following information/clarification should be added to $exists documentation, to greatly reduce repetitive questions support is getting about the performance of exists :
add a new section to the $exists page- Improving $EXISTS performancewhen running a query for retrieve/count documents where field:{ $exists:true} This is highly inefficient and significantly degrades query performance For example :
(query meaning - search for documents where the auditDate field exists in a collection (either with a value or with a null value) To make such query more efficient - a sparse index should be created over the specific field. example for creating a sparse index:
When the sparse index is in place, such a query will run exclusively using the index with increased efficiency and speed. an alternative query to using $exists: (Relevant for use cases where a user is looking only for documents where the field we are querying by is not-null) using a standard index (no need for sparse index) , run:
|
| Comments |
| Comment by Githook User [ 09/Nov/21 ] |
|
Author: {'name': 'jason-price-mongodb', 'email': '69260375+jason-price-mongodb@users.noreply.github.com', 'username': 'jason-price-mongodb'}Message: Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com> Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com> |
| Comment by Githook User [ 09/Nov/21 ] |
|
Author: {'name': 'jason-price-mongodb', 'email': '69260375+jason-price-mongodb@users.noreply.github.com', 'username': 'jason-price-mongodb'}Message: Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com> Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com> |
| Comment by Githook User [ 09/Nov/21 ] |
|
Author: {'name': 'jason-price-mongodb', 'email': '69260375+jason-price-mongodb@users.noreply.github.com', 'username': 'jason-price-mongodb'}Message: Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com> Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com> |
| Comment by Githook User [ 09/Nov/21 ] |
|
Author: {'name': 'jason-price-mongodb', 'email': '69260375+jason-price-mongodb@users.noreply.github.com', 'username': 'jason-price-mongodb'}Message: Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com> Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com> |
| Comment by Githook User [ 09/Nov/21 ] |
|
Author: {'name': 'jason-price-mongodb', 'email': '69260375+jason-price-mongodb@users.noreply.github.com', 'username': 'jason-price-mongodb'}Message: Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com> |
| Comment by Dror Mikdash (Inactive) [ 09/Nov/21 ] |
|
jason.price saw the changes. lgtm |
| Comment by Dave Cuthbert (Inactive) [ 14/Sep/21 ] |
|
dror.mikdash Is this new in version 5.0 or does the behavior also show up in earlier MDB versions? |