diff --git a/samples/features/json/product-catalog/dotnet-jquery-bootstrap-app/Controllers/ProductController.cs b/samples/features/json/product-catalog/dotnet-jquery-bootstrap-app/Controllers/ProductController.cs index da373ffbd4..1ee24cda2b 100644 --- a/samples/features/json/product-catalog/dotnet-jquery-bootstrap-app/Controllers/ProductController.cs +++ b/samples/features/json/product-catalog/dotnet-jquery-bootstrap-app/Controllers/ProductController.cs @@ -88,5 +88,40 @@ public async Task Delete(int id) cmd.Parameters.AddWithValue("id", id); await sqlCmd.ExecuteNonQuery(cmd); } + + // GET api/Product/Report1 + [HttpGet("Report1")] + public async Task Report1() + { + await sqlQuery.Stream( +@"select Color as [key], + AVG( Price ) as value +from Product +group by Color +FOR JSON PATH", Response.Body, "[]"); + } + + // GET api/Product/Report2 + [HttpGet("Report2")] + public async Task Report2() + { + await sqlQuery.Stream(@" +select Color as x, + AVG (Price) / MAX(Price) as y +from Product +group by Color +FOR JSON PATH", Response.Body, "[]"); + } + + [HttpGet("Report3")] + public async Task Report3() + { + await sqlQuery.Stream(@" +select Color as x, + AVG (Price) / MAX(Price) as y +from Product +group by Color +FOR JSON PATH", Response.Body, "[]"); + } } } \ No newline at end of file diff --git a/samples/features/json/product-catalog/dotnet-jquery-bootstrap-app/sql-scripts/demo.sql b/samples/features/json/product-catalog/dotnet-jquery-bootstrap-app/sql-scripts/demo.sql index 091b0579cf..c848b0729e 100644 --- a/samples/features/json/product-catalog/dotnet-jquery-bootstrap-app/sql-scripts/demo.sql +++ b/samples/features/json/product-catalog/dotnet-jquery-bootstrap-app/sql-scripts/demo.sql @@ -19,6 +19,24 @@ group by JSON_VALUE(Data, '$.Type'), Color having JSON_VALUE(Data, '$.Type') is not null order by JSON_VALUE(Data, '$.Type') +-- Indexing JSON data +drop index if exists json_index on Product + +alter table product +add Type AS JSON_VALUE(Data, '$.Type'), + ManufacturingCost AS cast(JSON_VALUE(Data, '$.ManufacturingCost') as float) + +create index json_index on Product(Type, Color) + include (ManufacturingCost) + +--Query uses index on JSON and relational columns +select JSON_VALUE(Data, '$.Type') as Type, Color, + AVG( cast(JSON_VALUE(Data, '$.ManufacturingCost') as float) ) as Cost +from Product +group by JSON_VALUE(Data, '$.Type'), Color +having JSON_VALUE(Data, '$.Type') is not null +order by JSON_VALUE(Data, '$.Type') + --Update JSON Data --Current values in row: select Data,Tags diff --git a/samples/features/json/product-catalog/dotnet-jquery-bootstrap-app/sql-scripts/setup.sql b/samples/features/json/product-catalog/dotnet-jquery-bootstrap-app/sql-scripts/setup.sql index 67682b40fd..8e019aecfd 100644 --- a/samples/features/json/product-catalog/dotnet-jquery-bootstrap-app/sql-scripts/setup.sql +++ b/samples/features/json/product-catalog/dotnet-jquery-bootstrap-app/sql-scripts/setup.sql @@ -29,7 +29,7 @@ SET IDENTITY_INSERT Product ON GO DECLARE @products NVARCHAR(MAX) = -N'[{"ProductID":15,"Name":"Adjustable Race","Color":"Magenta","Size":"62","Price":100.0000,"Quantity":75,"Data":{"Type":"Part","MadeIn":"China"}},{"ProductID":16,"Name":"Bearing Ball","Color":"Magenta","Size":"62","Price":15.9900,"Quantity":90,"Data":{"ManufacturingCost":11.672700,"Type":"Part","MadeIn":"China"},"Tags":["promo"]},{"ProductID":17,"Name":"BB Ball Bearing","Color":"Magenta","Size":"62","Price":28.9900,"Quantity":80,"Data":{"ManufacturingCost":21.162700,"Type":"Part","MadeIn":"China"}},{"ProductID":18,"Name":"Blade","Color":"Magenta","Size":"62","Price":18.0000,"Quantity":45,"Data":{},"Tags":["new"]},{"ProductID":19,"Name":"Sport-100 Helmet, Red","Color":"Red","Size":"72","Price":41.9900,"Quantity":38,"Data":{"ManufacturingCost":30.652700,"Type":"Еquipment","MadeIn":"China"},"Tags":["promo"]},{"ProductID":20,"Name":"Sport-100 Helmet, Black","Color":"Black","Size":"72","Price":31.4900,"Quantity":60,"Data":{"ManufacturingCost":22.987700,"Type":"Еquipment","MadeIn":"China"},"Tags":["new","promo"]},{"ProductID":21,"Name":"Mountain Bike Socks, M","Color":"White","Size":"M","Price":560.9900,"Quantity":30,"Data":{"Type":"Clothes"},"Tags":["sales","promo"]},{"ProductID":22,"Name":"Mountain Bike Socks, L","Color":"White","Size":"L","Price":120.9900,"Quantity":20,"Data":{"ManufacturingCost":88.322700,"Type":"Clothes"},"Tags":["sales","promo"]},{"ProductID":23,"Name":"Long-Sleeve Logo Jersey, XL","Color":"Multi","Size":"XL","Price":44.9900,"Quantity":60,"Data":{"ManufacturingCost":32.842700,"Type":"Clothes"},"Tags":["sales","promo"]},{"ProductID":24,"Name":"Road-650 Black, 52","Color":"Black","Size":"52","Price":704.6900,"Quantity":70,"Data":{"Type":"Bike","MadeIn":"UK"}},{"ProductID":25,"Name":"Mountain-100 Silver, 38","Color":"Silver","Size":"38","Price":359.9900,"Quantity":45,"Data":{"ManufacturingCost":262.792700,"Type":"Bike","MadeIn":"UK"},"Tags":["promo"]},{"ProductID":26,"Name":"Road-250 Black, 48","Color":"Black","Size":"48","Price":299.0200,"Quantity":25,"Data":{"ManufacturingCost":218.284600,"Type":"Bike","MadeIn":"UK"},"Tags":["new","promo"]},{"ProductID":27,"Name":"ML Bottom Bracket","Price":101.2400,"Quantity":50,"Data":{"Type":"Part","MadeIn":"China"}},{"ProductID":28,"Name":"HL Bottom Bracket","Price":121.4900,"Quantity":65,"Data":{"ManufacturingCost":88.687700,"Type":"Part","MadeIn":"China"}}]' +N'[{"ProductID":15,"Name":"Adjustable Race","Color":"Magenta","Size":"62","Price":100.0000,"Quantity":75,"Data":{"Type":"Part","MadeIn":"China"}},{"ProductID":16,"Name":"Bearing Ball","Color":"Magenta","Size":"62","Price":15.9900,"Quantity":90,"Data":{"ManufacturingCost":11.672700,"Type":"Part","MadeIn":"China"},"Tags":["promo"]},{"ProductID":17,"Name":"BB Ball Bearing","Color":"Magenta","Size":"62","Price":28.9900,"Quantity":80,"Data":{"ManufacturingCost":21.162700,"Type":"Part","MadeIn":"China"}},{"ProductID":18,"Name":"Blade","Color":"Magenta","Size":"62","Price":18.0000,"Quantity":45,"Data":{},"Tags":["new"]},{"ProductID":19,"Name":"Sport-100 Helmet, Red","Color":"Red","Size":"72","Price":41.9900,"Quantity":38,"Data":{"ManufacturingCost":30.652700,"Type":"Еquipment","MadeIn":"China"},"Tags":["promo"]},{"ProductID":20,"Name":"Sport-100 Helmet, Black","Color":"Black","Size":"72","Price":31.4900,"Quantity":60,"Data":{"ManufacturingCost":22.987700,"Type":"Еquipment","MadeIn":"China"},"Tags":["new","promo"]},{"ProductID":21,"Name":"Mountain Bike Socks, M","Color":"White","Size":"M","Price":560.9900,"Quantity":30,"Data":{"Type":"Clothes"},"Tags":["sales","promo"]},{"ProductID":22,"Name":"Mountain Bike Socks, L","Color":"White","Size":"L","Price":120.9900,"Quantity":20,"Data":{"ManufacturingCost":88.322700,"Type":"Clothes"},"Tags":["sales","promo"]},{"ProductID":23,"Name":"Long-Sleeve Logo Jersey, XL","Color":"Multi","Size":"XL","Price":44.9900,"Quantity":60,"Data":{"ManufacturingCost":32.842700,"Type":"Clothes"},"Tags":["sales","promo"]},{"ProductID":24,"Name":"Road-650 Black, 52","Color":"Black","Size":"52","Price":704.6900,"Quantity":70,"Data":{"Type":"Bike","MadeIn":"UK","Tyres":["300c","35C"],"Weight":9.5,"Gender":"M"}},{"ProductID":25,"Name":"Mountain-100 Silver, 38","Color":"Silver","Size":"38","Price":359.9900,"Quantity":45,"Data":{"ManufacturingCost":262.792700,"Type":"Bike","MadeIn":"UK","Gears":20,"Weight":9.5,"Gender":"M"},"Tags":["promo"]},{"ProductID":26,"Name":"Road-250 Black, 48","Color":"Black","Size":"48","Price":299.0200,"Quantity":25,"Data":{"ManufacturingCost":218.284600,"Type":"Bike","MadeIn":"UK"},"Tags":["new","promo"]},{"ProductID":27,"Name":"ML Bottom Bracket","Price":101.2400,"Quantity":50,"Data":{"Type":"Part","MadeIn":"China"}},{"ProductID":28,"Name":"HL Bottom Bracket","Price":121.4900,"Quantity":65,"Data":{"ManufacturingCost":88.687700,"Type":"Part","MadeIn":"China"}},{"ProductID":29,"Name":"Sport Helmet","Color":"Black","Size":"72","Price":55.9900,"Quantity":20,"Data":{"Visor":true, "WxDxH": [32,26.4,22]},"Tags":["promo"]},{"ProductID":30,"Name":"Hybrid Car XLV","Color":"Silver","Price":29500.0000,"Quantity":5,"Data":{"Type":"Car","Doors":4,"Seats":5,"MPG":29}},{"ProductID":31,"Name":"Car, Hybrid (OM)","Color":"White","Price":35000.0000,"Quantity":2,"Data":{"Type":"Car","Doors":2,"Seats":2,"MPG":35},"Tags":["promo"]}]' INSERT INTO Product (ProductID, Name, Color, Size, Price, Quantity, Data, Tags) SELECT ProductID, Name, Color, Size, Price, Quantity, Data, Tags FROM OPENJSON (@products) WITH( diff --git a/samples/features/json/product-catalog/dotnet-jquery-bootstrap-app/wwwroot/dashboard.html b/samples/features/json/product-catalog/dotnet-jquery-bootstrap-app/wwwroot/dashboard.html new file mode 100644 index 0000000000..9726848cee --- /dev/null +++ b/samples/features/json/product-catalog/dotnet-jquery-bootstrap-app/wwwroot/dashboard.html @@ -0,0 +1,52 @@ + + +
+ + + + + + + + +c)break;v.push(l)}}else for(;h
=1;--f)if(!((l=s*f)c)break;v.push(l)}}else v=tf(h,p,Math.min(p-h,d)).map(u);return n?v.reverse():v},e.tickFormat=function(n,r){if(null==r&&(r=10===i?".0e":","),"function"!=typeof r&&(r=t.format(r)),n===1/0)return r;null==n&&(n=10);var a=Math.max(1,i*n/e.ticks().length);return function(t){var n=t/u(Math.round(o(t)));return n*i t.r&&(t.r=t[n].r)}function r(){if(i){var n,e,r=i.length;for(o=new Array(r),n=0;n c)break;v.push(l)}}else for(;h=c)return-1;if(37===(i=n.charCodeAt(u++))){if(i=n.charAt(u++),!(o=B[i in qx?n.charAt(u++):i])||(r=o(t,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}function i(t,n,e){var r=C.exec(n.slice(e));return r?(t.p=z[r[0].toLowerCase()],e+r[0].length):-1}function o(t,n,e){var r=R.exec(n.slice(e));return r?(t.w=q[r[0].toLowerCase()],e+r[0].length):-1}function u(t,n,e){var r=P.exec(n.slice(e));return r?(t.w=L[r[0].toLowerCase()],e+r[0].length):-1}function a(t,n,e){var r=O.exec(n.slice(e));return r?(t.m=F[r[0].toLowerCase()],e+r[0].length):-1}function c(t,n,e){var r=U.exec(n.slice(e));return r?(t.m=D[r[0].toLowerCase()],e+r[0].length):-1}function s(t,n,e){return r(t,w,n,e)}function f(t,n,e){return r(t,M,n,e)}function l(t,n,e){return r(t,T,n,e)}function h(t){return N[t.getDay()]}function p(t){return S[t.getDay()]}function d(t){return A[t.getMonth()]}function v(t){return E[t.getMonth()]}function _(t){return k[+(t.getHours()>=12)]}function g(t){return N[t.getUTCDay()]}function y(t){return S[t.getUTCDay()]}function m(t){return A[t.getUTCMonth()]}function x(t){return E[t.getUTCMonth()]}function b(t){return k[+(t.getUTCHours()>=12)]}var w=t.dateTime,M=t.date,T=t.time,k=t.periods,S=t.days,N=t.shortDays,E=t.months,A=t.shortMonths,C=ia(k),z=oa(k),P=ia(S),L=oa(S),R=ia(N),q=oa(N),U=ia(E),D=oa(E),O=ia(A),F=oa(A),I={a:h,A:p,b:d,B:v,c:null,d:xa,e:xa,H:ba,I:wa,j:Ma,L:Ta,m:ka,M:Sa,p:_,S:Na,U:Ea,w:Aa,W:Ca,x:null,X:null,y:za,Y:Pa,Z:La,"%":Wa},Y={a:g,A:y,b:m,B:x,c:null,d:Ra,e:Ra,H:qa,I:Ua,j:Da,L:Oa,m:Fa,M:Ia,p:b,S:Ya,U:Ba,w:ja,W:Ha,x:null,X:null,y:Xa,Y:Va,Z:$a,"%":Wa},B={a:o,A:u,b:a,B:c,c:s,d:pa,e:pa,H:va,I:va,j:da,L:ya,m:ha,M:_a,p:i,S:ga,U:aa,w:ua,W:ca,x:f,X:l,y:fa,Y:sa,Z:la,"%":ma};return I.x=n(M,I),I.X=n(T,I),I.c=n(w,I),Y.x=n(M,Y),Y.X=n(T,Y),Y.c=n(w,Y),{format:function(t){var e=n(t+="",I);return e.toString=function(){return t},e},parse:function(t){var n=e(t+="",Qu);return n.toString=function(){return t},n},utcFormat:function(t){var e=n(t+="",Y);return e.toString=function(){return t},e},utcParse:function(t){var n=e(t,Ku);return n.toString=function(){return t},n}}}function ea(t,n,e){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(ot||t>i||r>n||n>o))return this;var u,a,c=i-e,s=this._root;switch(a=(n<(r+o)/2)<<1|t<(e+i)/2){case 0:do{u=new Array(4),u[a]=s,s=u}while(c*=2,i=e+c,o=r+c,t>i||n>o);break;case 1:do{u=new Array(4),u[a]=s,s=u}while(c*=2,e=i-c,o=r+c,e>t||n>o);break;case 2:do{u=new Array(4),u[a]=s,s=u}while(c*=2,i=e+c,r=o-c,t>i||r>n);break;case 3:do{u=new Array(4),u[a]=s,s=u}while(c*=2,e=i-c,r=o-c,e>t||r>n)}this._root&&this._root.length&&(this._root=s)}return this._x0=e,this._y0=r,this._x1=i,this._y1=o,this},Qd=function(){var t=[];return this.visit(function(n){if(!n.length)do{t.push(n.data)}while(n=n.next)}),t},Kd=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},tv=function(t,n,e,r,i){this.node=t,this.x0=n,this.y0=e,this.x1=r,this.y1=i},nv=function(t,n,e){var r,i,o,u,a,c,s,f=this._x0,l=this._y0,h=this._x1,p=this._y1,d=[],v=this._root;for(v&&d.push(new tv(v,f,l,h,p)),null==e?e=1/0:(f=t-e,l=n-e,h=t+e,p=n+e,e*=e);c=d.pop();)if(!(!(v=c.node)||(i=c.x0)>h||(o=c.y0)>p||(u=c.x1)1?r[0]+r.slice(2):r,+t.slice(e+1)]},xv=function(t){return t=mv(Math.abs(t)),t?t[1]:NaN},bv=function(t,n){return function(e,r){for(var i=e.length,o=[],u=0,a=t[0],c=0;i>0&&a>0&&(c+a+1>r&&(a=Math.max(1,r-c)),o.push(e.substring(i-=a,i+a)),!((c+=a+1)>r));)a=t[u=(u+1)%t.length];return o.reverse().join(n)}},wv=function(t){return function(n){return n.replace(/[0-9]/g,function(n){return t[+n]})}},Mv=function(t,n){t=t.toPrecision(n);t:for(var e,r=t.length,i=1,o=-1;i1?n:1)},e
+}(Wy),tm=function(t){for(var n,e=-1,r=t.length,i=t[r-1],o=0;++eyb&&w>yb?N>yb?(_=lc(L,R,q,U,f,-N,v),g=lc(z,P,D,O,f,-N,v),c.lineTo(_.cx+_.x01,_.cy+_.y01),N=f;--l)s.point(_[l],g[l]);s.lineEnd(),s.areaEnd()}v&&(_[n]=+e(h,n,t),g[n]=+i(h,n,t),s.point(r?+r(h,n,t):_[n],o?+o(h,n,t):g[n]))}if(p)return s=null,p+""||null}function n(){return Tb().defined(u).curve(c).context(a)}var e=pc,r=null,i=fb(0),o=dc,u=fb(!0),a=null,c=Mb,s=null;return t.x=function(n){return arguments.length?(e="function"==typeof n?n:fb(+n),r=null,t):e},t.x0=function(n){return arguments.length?(e="function"==typeof n?n:fb(+n),t):e},t.x1=function(n){return arguments.length?(r=null==n?null:"function"==typeof n?n:fb(+n),t):r},t.y=function(n){return arguments.length?(i="function"==typeof n?n:fb(+n),o=null,t):i},t.y0=function(n){return arguments.length?(i="function"==typeof n?n:fb(+n),t):i},t.y1=function(n){return arguments.length?(o=null==n?null:"function"==typeof n?n:fb(+n),t):o},t.lineX0=t.lineY0=function(){return n().x(e).y(i)},t.lineY1=function(){return n().x(e).y(o)},t.lineX1=function(){return n().x(r).y(i)},t.defined=function(n){return arguments.length?(u="function"==typeof n?n:fb(!!n),t):u},t.curve=function(n){return arguments.length?(c=n,null!=a&&(s=c(a)),t):c},t.context=function(n){return arguments.length?(null==n?a=s=null:s=c(a=n),t):a},t},Sb=function(t,n){return n0){for(var e,r,i,o=0,u=t[0].length;o0){for(var e,r=0,i=t[n[0]],o=i.length;r
+[Run this sample](#run-this-sample)
+[Sample details](#sample-details)
+[Disclaimers](#disclaimers)
+[Related links](#related-links)
+
+
+
+## About this sample
+
+- **Applies to:** SQL Server 2016 (or higher), Azure SQL Database
+- **Key features:** JSON functions in SQL Server 2016/Azure SQL Database
+- **Programming Language:** Html/JavaScript/Node.js, Transact-SQL
+- **Authors:** Jovan Popovic
+
+
+
+## Before you begin
+
+To run this sample, you need the following prerequisites.
+
+**Software prerequisites:**
+
+1. SQL Server 2016 (or higher) or an Azure SQL Database
+2. Node.js installation
+
+**Azure prerequisites:**
+
+1. Permission to create an Azure SQL Database
+
+
+
+## Run this sample
+
+1. Create a database on SQL Server 2016 or Azure SQL Database and set compatibility level to 130.
+
+2. From SQL Server Management Studio or Sql Server Data Tools connect to your SQL Server 2016 or Azure SQL database and execute [sql-scripts/setup.sql](sql-scripts/setup.sql) script that will create and populate Product table and create required stored procedures.
+
+3. From command line run **npm update** to update node.js packages.
+
+4. Setup connection information db.js
+
+5. Build and run sample using **npm build** and **npm run**.
+
+6. Run the sample app using F5 or Ctrl+F5 in Visual Studio 2015, or using **dotnet run** executed in the command prompt of the project root folder.
+ 1. Open http://localhost:3000/index.html to get all products from database,
+ 2. Use **Add** button to add a new product,
+ 3. Edit a product using **Edit** button in table,
+ 4. Delete a product using **Delete** button in table,
+
+
+
+## Sample details
+
+This sample application shows how to display list of products, add, edit or delete some product.
+Front-end code is implemented using JQuery/Bootstrap libraries, and JQuery DataTable component for displaying data in table.
+Server-side code is implemented using Node.js Express4 REST API.
+SQL Server JSON functions are used to format product data that will be sent to front-end page.
+
+
+
+## Disclaimers
+The code included in this sample is not intended demonstrate some general guidance and architectural patterns for web development. It contains minimal code required to create REST API.
+You can easily modify this code to fit the architecture of your application.
+
+
+
+## Related Links
+
+You can find more information about the components that are used in this sample on these locations:
+- [JSON Support in Sql Server](https://msdn.microsoft.com/en-us/library/dn921897.aspx).
+- [JQuery](https://jquery.com/).
+- [Bootstrap](http://getbootstrap.com/).
+- [JQuery DataTables](https://datatables.net/).
+- [JQuery SerializeJson](https://github.com/marioizquierdo/jquery.serializeJSON/).
+- [Toastr](http://codeseven.github.io/toastr/).
+
+## Code of Conduct
+This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
+
+## License
+These samples and templates are all licensed under the MIT license. See the license.txt file in the root.
+
+## Questions
+Email questions to: [sqlserversamples@microsoft.com](mailto: sqlserversamples@microsoft.com).
\ No newline at end of file
diff --git a/samples/features/json/product-catalog/nodejs-jquery-bootstrap-app/app.js b/samples/features/json/product-catalog/nodejs-jquery-bootstrap-app/app.js
new file mode 100644
index 0000000000..2f720268b1
--- /dev/null
+++ b/samples/features/json/product-catalog/nodejs-jquery-bootstrap-app/app.js
@@ -0,0 +1,22 @@
+var express = require('express');
+var bodyParser = require('body-parser');
+
+var app = express();
+app.use(express.static('wwwroot'));
+//app.use(bodyParser.json());
+app.use(bodyParser.text({ type: 'application/json' }))
+app.use('/api/Product', require('./routes/products'));
+
+// catch 404 and forward to error handler
+app.use(function (req, res, next) {
+ var err = new Error('Not Found' + req.originalUrl);
+ err.status = 404;
+ next(err);
+});
+app.set('port', process.env.PORT || 3000);
+
+var server = app.listen(app.get('port'), function() {
+ console.log('Express server listening on port ' + server.address().port);
+});
+
+module.exports = app;
diff --git a/samples/features/json/product-catalog/nodejs-jquery-bootstrap-app/bin/www b/samples/features/json/product-catalog/nodejs-jquery-bootstrap-app/bin/www
new file mode 100644
index 0000000000..4d9bddf04e
--- /dev/null
+++ b/samples/features/json/product-catalog/nodejs-jquery-bootstrap-app/bin/www
@@ -0,0 +1,3 @@
+#!/usr/bin/env node
+var debug = require('debug')('nodejs_express4_rest_api');
+var app = require('../app');
diff --git a/samples/features/json/product-catalog/nodejs-jquery-bootstrap-app/db.js b/samples/features/json/product-catalog/nodejs-jquery-bootstrap-app/db.js
new file mode 100644
index 0000000000..9846099c75
--- /dev/null
+++ b/samples/features/json/product-catalog/nodejs-jquery-bootstrap-app/db.js
@@ -0,0 +1,85 @@
+function createConnection() {
+
+ var config = {
+ server : "Products
+
+
+
+
+
+
+
+
+
+
+ Product
+ Color
+ Price
+ Quantity
+ Made in
+ Tags
+
+
+ l&&(l=i));for(fHv&&(Hv=u):(s=(s+360)%360-180,f^(c*XvHv&&(Hv=n))),f?t1&&em(t[e[r-2]],t[e[r-1]],t[i])<=0;)--r;e[r++]=i}return e.slice(0,r)}function hu(t){if(!(t>=1))throw new Error;this._size=t,this._call=this._error=null,this._tasks=[],this._data=[],this._waiting=this._active=this._ended=this._start=0}function pu(t){if(!t._start)try{du(t)}catch(n){if(t._tasks[t._ended+t._active-1])_u(t,n);else if(!t._data)throw n}}function du(t){for(;t._start=t._waiting&&t._active