[SERVER-6335] aggregation framework: disallow $where in $match Created: 06/Jul/12  Updated: 15/Aug/12  Resolved: 12/Jul/12

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: 2.1.2
Fix Version/s: 2.2.0-rc0

Type: Bug Priority: Major - P3
Reporter: Robert Pintarelli Assignee: Mathias Stearn
Resolution: Done Votes: 0
Labels: crash
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

linux x86-64


Operating System: ALL
Participants:

 Description   

server gets a segfault when using $where operator in a pipeline, e.g.:

db.blah.aggregate({$match: {$where: "return true;"}}) crashes the server.



 Comments   
Comment by auto [ 13/Jul/12 ]

Author:

{u'date': u'2012-07-13T07:30:36-07:00', u'email': u'samk@10gen.com', u'name': u'Sam Kleinman'}

Message: SERVER-6335 aggreation: no operations in statements
Branch: master
https://github.com/mongodb/docs/commit/93f18db9910d1bd0f7b6197cc9348f429a0166f5

Comment by auto [ 12/Jul/12 ]

Author:

{u'date': u'2012-07-12T14:53:45-07:00', u'email': u'mathias@10gen.com', u'name': u'Mathias Stearn'}

Message: SERVER-6335 don't allow $where inside aggregation $match
Branch: master
https://github.com/mongodb/mongo/commit/a807e3ef56902fa67435dc6cef7d0b9714c15a73

Comment by Robert Pintarelli [ 10/Jul/12 ]

I tried to reduce the number of "$unwind" and "$group" steps in an aggreation pipeline with a single $where construct to test which pipeline performs better.

Comment by Mathias Stearn [ 09/Jul/12 ]

@Robert: do you have a use case where $where is needed in aggregation? There shouldn't be anything that needs it at this point. One exception would be accessing other objects through the db variable, but that wouldn't work correctly anyway.

Comment by Mathias Stearn [ 09/Jul/12 ]

$where can't be supported for 2.2 because it will not work in mongos

Generated at Thu Feb 08 03:11:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.