[DOCS-13391] Clarify documentation for $ne/$not:null+$elemMatch Created: 05/Feb/20  Updated: 30/Oct/23

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Task Priority: Major - P3
Reporter: Eric Sedor Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: docs-query, grab-bag
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 1 year, 14 weeks, 2 days ago
Epic Link: DOCSP-1769

 Description   

Description

This is a follow-up to SERVER-31876 and HELP-13248.

It is asserted that "$ne is just $not" which is not clear from current documentation. Users see some confusing behavior, but it's not clear what the best change to suggest is. Hopefully this can be determined with some follow-up.

Some notes from HELP-13248:

https://docs.mongodb.com/manual/tutorial/query-array-of-documents/index.html#specify-a-query-condition-on-a-field-embedded-in-an-array-of-documents
"has at least one embedded document"

https://docs.mongodb.com/manual/reference/operator/query/ne/index.html#op._S_ne
"$ne selects the documents where the value of the field is not equal to the specified value. This includes documents that do not contain the field."

https://docs.mongodb.com/manual/reference/operator/query/not/
"$not performs a logical NOT operation on the specified <operator-expression> and selects the documents that do not match the <operator-expression>. This includes documents that do not contain the field."

"the $not operator only affects other operators and cannot check fields and documents independently. So, use the $not operator for logical disjunctions and the $ne operator to test the contents of fields directly."

Scope of changes

Impact to Other Docs

MVP (Work and Date)

Resources (Scope or Design Docs, Invision, etc.)



 Comments   
Comment by Education Bot [ 31/Oct/22 ]

Hello! This ticket has been closed due to inactivity. If you believe this ticket is still important, please reopen it and leave a comment to explain why. Thank you!

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