[DOCS-10024] Include limitations in $match docs Created: 22/Mar/17  Updated: 30/Oct/23  Resolved: 23/Oct/18

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

Type: Task Priority: Minor - P4
Reporter: Nathan Leniz Assignee: Kay Kim (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 5 years, 16 weeks, 1 day ago
Epic Link: DOCSP-1769

 Description   

The page for $match should include the limitations like other aggregation docs pages do. Specifically, it'd be nice for people in the future to see something along the lines of
`$match does not have support for Expressions`



 Comments   
Comment by Githook User [ 23/Oct/18 ]

Author:

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

Message: DOCS-10024: match stage and agg expressions
Branch: v3.6
https://github.com/mongodb/docs/commit/3fecd1c4c4e255cdda60d902bce141d7c20c2ad4

Comment by Githook User [ 23/Oct/18 ]

Author:

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

Message: DOCS-10024: match stage and agg expressions
Branch: v4.0
https://github.com/mongodb/docs/commit/f1d3af885788998f7f217a299f2e9847633c9db1

Comment by Githook User [ 23/Oct/18 ]

Author:

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

Message: DOCS-10024: match stage and agg expressions
Branch: master
https://github.com/mongodb/docs/commit/bc1d5ef1264e4869ebaed9d23db4624a44c9bec4

Comment by Nathan Leniz [ 23/Oct/18 ]

kay.kim LGTM

Comment by William Cross [ 22/Mar/17 ]

Also, here's an example of where I'd want it to work, but it doesn't:

db.things.drop()  // initialize.
// Insert 100 documents, with all combinations of a & b from 1 to 10.
for (i=1; i<=10; i++) { for (j=1; j<=10; j++) { db.things.insertOne( { _id: (10 * i + j - 10 ), a : i, b : j } ) } }
db.things.insertOne( { _id : "showWhatTheDBIsDoing", a : "$b", b : "$a" } )  // Helps to see what the database is thinking.
db.things.aggregate( [ { $match : { a : "$b" } } ] )  // I want this to give me documents where a == b. 
// I am not thrilled with what I get.
db.things.aggregate( [ { $project : { a : 1, b : 1, keepThis : { $eq : [ "$a", "$b" ] } } }, { $match : { keepThis : true } }, { $project : { a : 1, b : 1 } } ] )
// I guess that works...

Comment by William Cross [ 22/Mar/17 ]

+1. Here are some links:

This is related to SERVER-7621 and SERVER-7623; the fact that this functionality isn't in place anywhere can be a bit surprising to users.

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