[COMPASS-4492] Remove support for $sql in Agg. Builder Created: 11/Nov/20  Updated: 19/Nov/20  Resolved: 19/Nov/20

Status: Closed
Project: Compass
Component/s: Aggregation pipeline
Affects Version/s: None
Fix Version/s: 1.24.1

Type: Task Priority: Major - P3
Reporter: Massimiliano Marcon Assignee: Rhys Howell
Resolution: Done Votes: 0
Labels: good-first-issue
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Documentation Changes: Not Needed
Sprint: Iteration Quince

 Description   

It turns out $sql is not a stage that can be used in an aggregation that is executed on a collection.

Essentially, it is not used like this:

db.listingsAndReviews.aggregate([{
  $sql: {
    statement: 'select * from listingsAndReviews limit 2',
    format: 'jdbc',
    dialect: 'mysql'
  }
}]);

it is used like this:

db.adminCommand({
  aggregate: 1,
  pipeline: [
    $sql: {
      statement: 'select * from listingsAndReviews limit 2',
      format: 'jdbc',
      dialect: 'mysql'
    }
  ]
});

additionally, in terms of use cases, $sql is built to support JDBC connections rather than as a user-facing stage. Therefore, it should be removed.



 Comments   
Comment by Rhys Howell [ 19/Nov/20 ]

VSCode PR: https://github.com/mongodb-js/vscode/pull/211

Comment by Githook User [ 19/Nov/20 ]

Author:

{'name': 'Rhys', 'email': 'Anemy@users.noreply.github.com', 'username': 'Anemy'}

Message: fix(COMPASS-4492): remove sql pipeline stage operator (#2062)
Branch: 1.24-releases
https://github.com/mongodb-js/compass/commit/c528caeb574f37a8f31bdad78325f566bc14ddae

Generated at Wed Feb 07 22:36:33 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.