Couchbase 中文教程
  • Introduction
  • Couchbase 简介
  • Couchbase 应用场景
  • Couchbase 安装
  • Couchbase UI
  • 使用Node.js客户端
    • 安装与入门
    • 基本操作
      • CRUD 基本操作
      • 计数器操作
      • 过期时间操作
      • 加锁/解锁操作
      • Map方式操作(针对文档字段)
      • List链表方式操作
      • Queue队列方式操作
      • Set集合方式操作
      • append 与 prepend操作
    • N1QL操作
    • Sub-Document 部分更新操作
  • N1QL 基础操作教程
    • 第一章:N1QL基础
      • 测试数据
      • 1.AS 字段别名
      • 2.SELECT,FROM,WHERE
      • 3.文档,而不是行
      • 4.文档元数据
      • 5.简单算术运算
      • 6.ROUND(),TRUNC()函数
      • 7.字符串拼接
      • 8.WHERE条件过滤
      • 9.LIKE, NOT LIKE匹配
      • 10.Select DISTINCT
      • 11.判断 NULL和MISSING值
      • 12.匹配的元素与任何嵌套的数组
      • 13.AND,OR 组合多个条件
      • 14.USE KEYS 关键词匹配查询
      • 15.数组操作和切片
      • 16.快速回顾
      • 17.排序 ORDER BY
      • 18.LIMIT 和 OFFSET
      • 19.COUNT() , AVG() 聚合函数
      • 20.GROUP BY 分组
      • 21.HAVING 分组数据的过滤
      • 22.数组简约式
      • 23.回顾
    • 第二章:Joins 连接查询
      • 测试桶数据
      • 24.JOIN 子句
      • 25.Left outer JOINs 左外连接
      • 26.NEST
      • 27.UNNEST
      • 28.组合JOIN
    • 第三章:DML语句
      • 29.CURL 语句
      • 30.DELETE 删除操作
      • 31.UPDATE 更新操作
    • 案例分析 I:电子商务
      • 32.介绍说明
      • 33.Shopper - 浏览产品页面
      • 34.Shopper - 产品categories列表
      • 35.Shopper - 浏览和搜索产品
      • 36.Shopper - 列出category下的产品清单
      • 37.Shopper - 在栏目中找到最流行的一些产品
      • 38.Shopper - 浏览产品和排序结果
      • 39.Shopper - 购买促销活动产品
      • 40.Shopper - 列出了十大最畅销的产品
      • 41.Shopper - 列出评价最高的产品
      • 42.Merchant -为一个购买订单做准备
      • 43.Merchant - 找到最有价值的顾客
      • 44.Merchant - 客户的地区分布报告
      • 45.Merchant - 每月报告活动的客户
      • 46.Merchant - 识别评分较低的产品
      • 47.Merchant - 生成上月销售报告
      • 48.Merchant - 大订单
    • 案例分析 II:社交游戏
      • 49.介绍说明
      • 50.组装和加载用户配置信息
      • 51.列出一个用户发送的消息
      • 52.生成记分牌
      • 53.生成全球排行榜
      • 54.列出朋友
  • N1QL 5.5 进阶教程
    • COUCHBASE 5.5:查询和索引特性概述
    • ANSI JOINs in N1QL
    • 索引分组和聚合
    • 索引分区
  • Couchbase 连接器
    • Elasticsearch
      • Elasticsearch 插件配置
      • 与Couchbase交互说明
      • 其他
  • CAS机制
  • 索引
  • 视图(view indexes)
  • API
  • 资料
  • 注意点
  • 数据导出
Powered by GitBook
On this page

Was this helpful?

  1. N1QL 基础操作教程
  2. 案例分析 I:电子商务

36.Shopper - 列出category下的产品清单

Don也还想浏览一些电器。也许想购买洗杯子的机器。

他点击网站上的“电器”菜单,他可以浏览和电器的有关的页面。

SELECT
    product.name, product.unitPrice, product.color
    FROM product UNNEST product.categories AS categories
    WHERE categories = "Appliances"

结果:

{
  "results": [
    {
      "color": "tan",
      "name": "Danby DAR125SLDD 4.4 cu.ft. All Refrigerator - Spotless Steel",
      "unitPrice": 199
    },
    {
      "color": "mint green",
      "name": "NewAir AI-100R 28-Pound Portable Icemaker, Red",
      "unitPrice": 183.53
    },
    {
      "color": "white",
      "name": "Danby DCR122BSLDD 3.2 cu.ft. Compact Refrigerator - Spotless Steel",
      "unitPrice": 169.99
    },
    {
      "color": "maroon",
      "name": "Haier HVTM12DABB 12-Bottle Dual Zone Mirrored Glass Door Wine Cellar",
      "unitPrice": 122.66
    },
    {
      "color": "salmon",
      "name": "NewAir AW-181E Space Saver 18 Bottle Thermoelectric Wine Cooler, Stainless Steel",
      "unitPrice": 189.95
    },
    {
      "color": "white",
      "name": "Deni 6100 Automatic 70-Watt Stainless-Steel Ice Crusher",
      "unitPrice": 39.96
    },
    {
      "color": "orange",
      "name": "Koolatron Compact Kooler",
      "unitPrice": 91.84
    },
    {
      "color": "azure",
      "name": "Waring Pro IC70 Professional Stainless Steel Large-Capacity Ice Crusher",
      "unitPrice": 73.95
    },
    {
      "color": "grey",
      "name": "Danby DCF700W1 7.0 cu.ft. Chest Freezer - White",
      "unitPrice": 297.96
    },
    {
      "color": "orchid",
      "name": "NewAir AI-100S 28-Pound Portable Ice Maker, Silver",
      "unitPrice": 183.53
    },
    {
      "color": "silver",
      "name": "Frigidaire : IM115 Ice Maker Kit",
      "unitPrice": 56.18
    },
    {
      "color": "orchid",
      "name": "AVANTI 8 BOTTLE THERMOELECTRIC WINE COOLER - BLACK CABINET W/STAINLESS STEEL FRONT FINISH AND GLASS DOOR",
      "unitPrice": 113
    },
    {
      "color": "pink",
      "name": "Koolatron Voyager Cooler",
      "unitPrice": 129.95
    },
    {
      "color": "white",
      "name": "Spt Thermo-Electric Wine Cooler with Heating, 12-Bottles",
      "unitPrice": 151.04
    },
    {
      "color": "indigo",
      "name": "AVANTI 12 BOTTLE WINE COOLER",
      "unitPrice": 111.68
    },
    {
      "color": "fuchsia",
      "name": "Wine Enthusiast Silent 12 Bottle Wine Refrigerator (Stainless Steel)",
      "unitPrice": 144.98
    },
    {
      "color": "ivory",
      "name": "Koldfront Ultra Compact Portable Ice Maker - White",
      "unitPrice": 120
    },
    {
      "color": "olive",
      "name": "Sunpentown UF-311S Energy Star 2.8 Cubic-Foot Upright Freezer, Stainless",
      "unitPrice": 269
    },
    {
      "color": "turquoise",
      "name": "Danby DIM1524W Designer Ice'nEasy Portable Ice Maker with LCD Display, White",
      "unitPrice": 230.05
    },
    {
      "color": "blue",
      "name": "Smart+ Products SPP15AIM Portable Stainless Steel Ice Maker",
      "unitPrice": 37.95
    },
    {
      "color": "salmon",
      "name": "Haier HLP21N Pulsator 1-Cubic-Foot Portable Washer",
      "unitPrice": 199.95
    },
    {
      "color": "teal",
      "name": "Bonus Package Panda Small Mini Portable Compact Washer Washing Machine 5.5lbs Capacity",
      "unitPrice": 89.99
    },
    {
      "color": "orchid",
      "name": "Sonya Portable Compact Small Laundry Dryer Apartment Size 110vstainless Steel Drum Transparent Lid 8.8lbs Capacity/2.65cu.ft.",
      "unitPrice": 209.99
    },
    {
      "color": "black",
      "name": "Mini Countertop Spin Dryer Clothes Spin Dryer Portable Clothes Dryer",
      "unitPrice": 69.95
    },
    {
      "color": "lavender",
      "name": "Panda Small Compact Portable Washing Machine(6-7lbs Capacity) with Spin Dryer",
      "unitPrice": 159.99
    },
    {
      "color": "sky blue",
      "name": "Baixt iphone 4 / 4s External Rechargeable Spare Backup Extended 2200 mAh Battery Charger Pack Case Cover for Apple iphone 4s Black",
      "unitPrice": 18.49
    },
    {
      "color": "sky blue",
      "name": "Mobile Washer (Hand Operated Washing Machine)",
      "unitPrice": 14.95
    },
    {
      "color": "orchid",
      "name": "Liying Colourful iPhone 4/4s 2000mah External Rechargeable Backup Battery Charger Case Cover for for Iphone 4 with Iphone 4s cases (Iphone 4/4s 2000 CRIMSON)",
      "unitPrice": 17.99
    },
    {
      "color": "violet",
      "name": "3D Bling Crystal IPone 5 Case for Lovely Apple iPhone 5 fashion case (White)",
      "unitPrice": 8.99
    },
    {
      "color": "lavender",
      "name": "EdgeStar 2.0 Cu. Ft. Ventless Combo Washer/Dryer - White",
      "unitPrice": 830.99
    },
    {
      "color": "orchid",
      "name": "Haier HLP140E 2-3/5-Cubic-Foot Compact Tumble Vented Dryer",
      "unitPrice": 289.95
    },
    {
      "color": "yellow",
      "name": "LG 3.6 CF FRONT LOAD WASHER DRYER COMBO",
      "unitPrice": 1499
    },
    {
      "color": "sky blue",
      "name": "Super Luxury Designer Crystal Bling Animal Cartoon Pattern Hard Case Cover for Apple iPhone 5 (Pink)",
      "unitPrice": 8.99
    },
    {
      "color": "ivory",
      "name": "Haier HLP23E Electronic 1-1/2-Cubic-Foot Touch Pulsator Top-Loading Portable Washing Machine",
      "unitPrice": 439.25
    },
    {
      "color": "indigo",
      "name": "Avanti 110-Volt Automatic  Dryer",
      "unitPrice": 284.99
    },
    {
      "color": "white",
      "name": "Electrolux Silver IQ Touch Front Load Washer and Steam ELECTRIC Dryer Laundry Set W/ Pedestals EIFLS60LSS_EIMED60LSS_EPWD15SS",
      "unitPrice": 2299.99
    },
    {
      "color": "grey",
      "name": "Haier HLP21N 6.6-Pound Pulsator Wash with Stainless Steel Tub",
      "unitPrice": 266.95
    },
    {
      "color": "azure",
      "name": "Super Luxury Designer Crystal Bling Animal Cartoon Pattern Hard Case Cover for Apple iPhone 4 4S (White Skirt Girl)",
      "unitPrice": 9.49
    },
    {
      "color": "sky blue",
      "name": "LG 3.6 Cu. Ft. White Front Load Steam Washer - WM2650HRA",
      "unitPrice": 892.49
    },
    {
      "color": "salmon",
      "name": "Z Line 36",
      "unitPrice": 299.25
    },
    {
      "color": "magenta",
      "name": "Broan PM390 Power Pack Range Hood Insert, Silver",
      "unitPrice": 204.55
    },
    {
      "color": "grey",
      "name": "Broan QS130SS Allure Range Hood, Stainless Steel, 30-inch",
      "unitPrice": 157.19
    },
    {
      "color": "sky blue",
      "name": "Broan 413023 30 In. Black Non-Ducted Range Hood",
      "unitPrice": 42
    },
    {
      "color": "grey",
      "name": "Broan F403004 30-Inch Two-Speed 4-Way Convertible Range Hood, Stainless Steel",
      "unitPrice": 59.95
    },
    {
      "color": "black",
      "name": "Z Line 30",
      "unitPrice": 299.25
    },
    {
      "color": "sky blue",
      "name": "Golden Vantage Stainless Steel 30",
      "unitPrice": 362
    },
    {
      "color": "turquoise",
      "name": "30-inch Wall-mounted Stainless Steel Range Hood with Arched Tempered Glass & Touch Screen Control Panel",
      "unitPrice": 299.99
    },
    {
      "color": "lime",
      "name": "Broan F403604 36-Inch Two Speed 4-Way Convertible Range Hood, Stainless Steel",
      "unitPrice": 60.71
    },
    {
      "color": "green",
      "name": "Air King AILT4 Lint Trap",
      "unitPrice": 42.36
    },
    {
      "color": "salmon",
      "name": "Broan RM503004 Chimney Range Hood, Stainless Steel, 30-Inch",
      "unitPrice": 374.99
    },
    {
      "color": "grey",
      "name": "Eureka-euro 30",
      "unitPrice": 429
    },
    {
      "color": "tan",
      "name": "36-inch Island-mounted Stainless Steel Range Hood with Arched Tempered Glass, Seamless Chimney & Touch Screen Control Panel",
      "unitPrice": 499.99
    },
    {
      "color": "maroon",
      "name": "Broan PM250 Power Module Range Hood, Silver",
      "unitPrice": 93.65
    },
    {
      "color": "gold",
      "name": "Broan QS136SS 36-Inch Allure Range Hood, Stainless steel",
      "unitPrice": 169.32
    },
    {
      "color": "plum",
      "name": "Golden Vantage Stainless Steel 36",
      "unitPrice": 418
    },
    {
      "color": "azure",
      "name": "Air King DS1308 Designer Series Under Cabinet Range Hood, 30 Inch Wide, Stainless Steel",
      "unitPrice": 78.99
    },
    {
      "color": "orange",
      "name": "Broan 403001 Economy 30-Inch Under Cabinet Ducted Range Hood, White",
      "unitPrice": 46.2
    },
    {
      "color": "black",
      "name": "Broan SP3604 Backsplash 24-Inch by 36-Inch Stainless Steel Range Hood Wall Shield",
      "unitPrice": 51.6
    },
    {
      "color": "violet",
      "name": "Broan 893604 Contemporary Under Cabinet 36-Inch Stainless Steel Range Hood",
      "unitPrice": 409
    },
    {
      "color": "teal",
      "name": "Ball Cap Buddy",
      "unitPrice": 5.61
    },
    {
      "color": "red",
      "name": "SPT Countertop Dishwasher, White",
      "unitPrice": 239.62
    },
    {
      "color": "green",
      "name": "Amana Tall Tub Dishwasher, ADB1400PYS, Stainless",
      "unitPrice": 417.49
    },
    {
      "color": "grey",
      "name": "SPT Countertop Dishwasher, Silver",
      "unitPrice": 250.45
    },
    {
      "color": "turquoise",
      "name": "Clean Day Liquid Dishwashing Soap (Set of 3) Flavor: Rosemary",
      "unitPrice": 19.4
    },
    {
      "color": "red",
      "name": "Danby DDW611WLED Countertop Dishwasher - White",
      "unitPrice": 239
    },
    {
      "color": "grey",
      "name": "Danby DDW1899BLS 18-Inch Built-In Dishwasher - Stainless Steel",
      "unitPrice": 462.95
    },
    {
      "color": "red",
      "name": "Band It Dishwasher Loop",
      "unitPrice": 8.01
    },
    {
      "color": "orchid",
      "name": "Koldfront Portable Countertop Dishwasher - White / 6 Place Setting",
      "unitPrice": 189
    },
    {
      "color": "orange",
      "name": "Frigidaire FFBD1821MS 1800 18",
      "unitPrice": 229
    },
    {
      "color": "grey",
      "name": "SPT 18-Inch Portable Dishwasher, Stainless Steel",
      "unitPrice": 496.39
    },
    {
      "color": "tan",
      "name": "Danby DDW1809W 18",
      "unitPrice": 372.96
    },
    {
      "color": "indigo",
      "name": "SPT 18-Inch Portable Dishwasher, White",
      "unitPrice": 449
    },
    {
      "color": "red",
      "name": "Bosch HEZ1090 LP Conversion Kit for Bosch Free-standing Gas Ranges (300 and 500 Series)",
      "unitPrice": 76
    },
    {
      "color": "silver",
      "name": "SPT-SD-2201S Countertop Dishwasher in Silver",
      "unitPrice": 259.08
    },
    {
      "color": "salmon",
      "name": "Danby DDW1899WP 8 Place Setting Portable Dishwasher - White",
      "unitPrice": 524
    },
    {
      "color": "black",
      "name": "Bosch NEZ1054 NLP Conversion Kit",
      "unitPrice": 104.87
    },
    {
      "color": "orange",
      "name": "Amana Standard Tub Dishwasher, ADB1000AWB, Black",
      "unitPrice": 393.99
    },
    {
      "color": "orchid",
      "name": "Miele Dishwasher Tabs 48 per Box - TotalVac Exclusive",
      "unitPrice": 23.3
    }
  ]
}
Previous35.Shopper - 浏览和搜索产品Next37.Shopper - 在栏目中找到最流行的一些产品

Last updated 6 years ago

Was this helpful?