You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: scratchpad.js
+7-8
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,4 @@
1
-
2
-
constSQLParser=require('./lib/SQLParser');
3
-
1
+
constSQLParser=require('./lib/SQLParser');
4
2
5
3
// let parsedVal=SQLParser.makeMongoAggregate("select c.*,`customer-notes`.*,cn2.* from customers c inner join `customer-notes` on `customer-notes`.id=c.id left outer join (select * from `customer-notes2` where id <3) cn2 on cn2.id=firstInArray(`customer-notes`.id)" )
6
4
// let parsedVal=SQLParser.makeMongoAggregate("select c.*,cn.* from customers c inner join `customer-notes` cn on cn.id=c.id and (cn.id>2 or cn.id<5)" )
// const parsedVal=SQLParser.makeMongoAggregate("select *,FIRST_IN_ARRAY(inventory) as inventory_docs from orders inner join `inventory` on orders.item=inventory.sku")
15
13
16
14
// let parsedVal=SQLParser.makeMongoAggregate("select * from `customers` where id in (select id from `customer notes` where abs(id) <10) and id in (select id from `customer notes` where abs(id) <10)")
17
-
constparsedVal=SQLParser.makeMongoAggregate("select c.*,cn.*,cn2.* from customers c inner join `customer-notes` cn on c.id=cn.id inner join `customer-notes2` cn2 on cn2.id=c.id")
15
+
// const parsedVal=SQLParser.makeMongoAggregate("select c.*,c2.test from customers c inner join `customer-notes` cn on c.id=cn.id inner join `customer-notes2` cn2 on cn2.id=c.id")
16
+
constparsedVal=SQLParser.makeMongoAggregate(
17
+
'select c.*,c2.test from customers c inner join `customer-notes` cn on c.id=cn.id where cn.id>1 and c.id>2'
18
+
);
19
+
18
20
// const parsedVal=SQLParser.makeMongoAggregate("Select VoucherName,Status,Sum(1) as Count,case when Status='Created' then 1 else 0 end as SortOrder from test group by VoucherName,Status order by VoucherName,Status")
19
21
// let parsedVal=SQLParser.makeMongoAggregate("select `Address.City` as City,abs(-1) as absId,avg(lengthOfArray(`Rentals`)) as AvgRentals from `customers` where `First Name` like 'm%' and absId >1 group by `Address.City`,absId")
20
22
// const parsedVal=SQLParser.makeMongoAggregate("select `First Name`,`Address.City` as City,abs(-1) as absId from `customers` where `First Name` like 'm%' and abs(-1) >=1")
21
23
22
24
// let parsedVal=SQLParser.makeMongoAggregate("select * from (select id,`First Name`,`Last Name`,lengthOfArray(Rentals,'id') from customers )")
23
25
// const parsedVal=SQLParser.makeMongoAggregate("select `Address.Country` as Country,sum(id) as totalId from customers group by `Address.Country`")
// select * from (select id,`First Name`,`Last Name`,lengthOfArray(Rentals,'id') from customers ) as t inner join (select id,`First Name`,`Last Name`,lengthOfArray(Rentals,'id') from customers ) as t2 on t2.id=t1.id
0 commit comments