当前位置: 首页 > news >正文

网站 注册模块怎么做下沙做网站的

网站 注册模块怎么做,下沙做网站的,北京网站建设公司网站优化,抖音seo搜索优化按照指定的表达式对输入文档进行分类后放入指定数字的桶中#xff0c;跟$bucket不太一样#xff0c;$bucketAuto可以指定分组的数量#xff08;颗粒度#xff09;#xff0c;$bucketAuto会根据groupBy的值和颗粒度自动生成桶的边界。 语法 {$bucketAuto: {groupBy: …按照指定的表达式对输入文档进行分类后放入指定数字的桶中跟$bucket不太一样$bucketAuto可以指定分组的数量颗粒度$bucketAuto会根据groupBy的值和颗粒度自动生成桶的边界。 语法 {$bucketAuto: {groupBy: 表达式,buckets: 数字,output: {输出1: { $accumulator 表达式 },...}granularity: 字符串} }groupBy 表达式对文档进行分组的表达式。若指定字段路径需要在字段名前加上美元符号$并用引号引起来如$field_name。 buckets 整数32位的正整数指定桶的数量也就是输入文档分组的数量。 output 文档可选指定了输出文档中除_id字段外要包含的其他字段必须要使用汇总累加器表达式 输出字段1: { accumulator: 表达式1 }, ...如果指定了输出字段则count字段不会自动添加需要的话要手动添加。如果不指定输出字段则默认添加一个count字段。 output: {输出字段1: { accumulator: expres表达式1sion1 },...count: { $sum: 1 } }每个桶文档包含 一个桶边界下限的_id _id.min字段指定了桶边界的下限含。_id.max字段指定了桶边界的上限不含。除系列中的最后一个桶外该界限对所有桶都是排他性的因为在最后一个桶中该界限是包含的。 count字段包含文件桶中的文件数量。如果未指定输出文档则默认包含count字段。 granularity 可选字符串指定了一个字符串用于指定首选数列以确保计算的边界边缘以首选的整数或其10的幂次结束。只有当所有groupBy值都是数值且都不是NaN时才有效。 支持的颗粒度“R5”“R10”“R20”“R40”“R80”“1-2-5”“E6”“E12”“E24”“E48”“E96”“E192”“POWERSOF2”。 说明 如果出现以下情况桶数量可能少于指定数量 输入文件的数量少于指定的文件桶数量。groupBy表达式的唯一值数量少于指定的存储桶数量。粒度的间隔数少于桶数。粒度不够精细无法将文档均匀分布到指定数量的桶中。 groupBy字段的粒度或唯一值的数量决定了文档是否能均匀分布到不同的桶。如果粒度不够$bucketAuto阶段可能无法将结果均匀地分配到各个桶。 粒度 $bucketAuto接受一个可选的粒度参数确保所有数据桶的边界都遵循指定的首选数列。使用首选数列可以更好地控制分组表达式中数值范围内的数据桶边界。当groupBy表达式的范围以指数形式扩展时还可以使用首选数列帮助对数和均匀地设置数据桶边界。 雷纳数列 雷纳数列是通过取10的5次方根、10次方根、20次方根、40次方根或80次方根然后将相当于1.0到 10.0R80 为 10.3之间数值的根的各种幂包含在内而得出的一组数字。 将粒度设置为 R5、R10、R20、R40 或 R80可将数据桶边界限制为系列中的值。当 groupBy 值超出 1.0 至 10.0R80 为 10.3范围时系列值将乘以 10 的幂。 R5 数列以 10 的五次方根 1.58 为基础包括该根的各种幂次四舍五入直至 10。R5 数列的推导过程如下 例如 10 0/5 110 1/5 1.584 ~ 1.610 2/5 2.511 ~ 2.510 3/5 3.981 ~ 4.010 4/5 6.309 ~ 6.310 5/5 10 同样的方法也适用于其他雷纳系列以提供更精细的粒度即 1.0 和 10.0 之间的更多间隔R80 为 10.3。 E 序列 E 数字系列与雷纳数列类似它们以特定的相对误差将 1.0 到 10.0 的区间细分为10的6、12、24、48、96或192的次方根。 将粒度设置为 E6、E12、E24、E48、E96 或 E192可将桶边界限制为序列中的值。当 groupBy 值超出 1.0 到 10.0 的范围时系列值将乘以 10 的幂。 1-2-5 序列 1-2-5 数列类似于三值数列雷纳数列。 将粒度设为 1-2-5可将桶边界限制为 10 的三次根的各种幂四舍五入到一位有效数字。 例如以下数值属于 1-2-5 系列0.1、0.2、0.5、1、2、5、10、20、50、100、200、500、1000 等… 2的次幂序列 将粒度设置为 POWERSOF2限制桶边界为2的次幂 以下数字遵循2的幂序列 2^0 12^1 22^2 42^3 82^4 162^5 32… 一种常见的实现方式是各种计算机组件如内存通常都遵守POWERSOF2的首选数字集1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, … 不同粒度的比较 下面的操作演示了指定不同的粒度值如何影响$bucketAuto确定桶边界的方式。集合的_id从 0 到 99 { _id: 0 } { _id: 1 } ... { _id: 99 }不同的粒度值会被代入到下面的操作中 db.things.aggregate( [{$bucketAuto: {groupBy: $_id,buckets: 5,granularity: granularity}} ] )下表中的结果显示了不同的粒度值如何产生不同的桶边界 粒度结果说明无粒度{ “_id” : { “min” : 0, “max” : 20 }, “count” : 20 }{ “_id” : { “min” : 20, “max” : 40 }, “count” : 20 }{ “_id” : { “min” : 40, “max” : 60 }, “count” : 20 }{ “_id” : { “min” : 60, “max” : 80 }, “count” : 20 }{ “_id” : { “min” : 80, “max” : 99 }, “count” : 20 }R20{ “_id” : { “min” : 0, “max” : 20 }, “count” : 20 }{ “_id” : { “min” : 20, “max” : 40 }, “count” : 20 }{ “_id” : { “min” : 40, “max” : 63 }, “count” : 23 }{ “_id” : { “min” : 63, “max” : 90 }, “count” : 27 }{ “_id” : { “min” : 90, “max” : 100 }, “count” : 10 }E24{ “_id” : { “min” : 0, “max” : 20 }, “count” : 20 }{ “_id” : { “min” : 20, “max” : 43 }, “count” : 23 }{ “_id” : { “min” : 43, “max” : 68 }, “count” : 25 }{ “_id” : { “min” : 68, “max” : 91 }, “count” : 23 }{ “_id” : { “min” : 91, “max” : 100 }, “count” : 9 }1-2-5{ “_id” : { “min” : 0, “max” : 20 }, “count” : 20 }{ “_id” : { “min” : 20, “max” : 50 }, “count” : 30 }{ “_id” : { “min” : 50, “max” : 100 }, “count” : 50 }指定的桶数超过系列中的间隔数。POWERSOF2{ “_id” : { “min” : 0, “max” : 32 }, “count” : 32 }{ “_id” : { “min” : 32, “max” : 64 }, “count” : 32 }{ “_id” : { “min” : 64, “max” : 128 }, “count” : 36 }指定的桶数超过系列中的间隔数。 举例 下面的文档是收藏艺术品的集合 { _id : 1, title : The Pillars of Society, artist : Grosz, year : 1926,price : NumberDecimal(199.99),dimensions : { height : 39, width : 21, units : in } } { _id : 2, title : Melancholy III, artist : Munch, year : 1902,price : NumberDecimal(280.00),dimensions : { height : 49, width : 32, units : in } } { _id : 3, title : Dancer, artist : Miro, year : 1925,price : NumberDecimal(76.04),dimensions : { height : 25, width : 20, units : in } } { _id : 4, title : The Great Wave off Kanagawa, artist : Hokusai,price : NumberDecimal(167.30),dimensions : { height : 24, width : 36, units : in } } { _id : 5, title : The Persistence of Memory, artist : Dali, year : 1931,price : NumberDecimal(483.00),dimensions : { height : 20, width : 24, units : in } } { _id : 6, title : Composition VII, artist : Kandinsky, year : 1913,price : NumberDecimal(385.00),dimensions : { height : 30, width : 46, units : in } } { _id : 7, title : The Scream, artist : Munch,price : NumberDecimal(159.00),dimensions : { height : 24, width : 18, units : in } } { _id : 8, title : Blue Flower, artist : OKeefe, year : 1918,price : NumberDecimal(118.42),dimensions : { height : 24, width : 20, units : in } }单面聚合 在下面的操作中输入文档将根据price字段中的值分成四组 db.artwork.aggregate( [{$bucketAuto: {groupBy: $price,buckets: 4}} ] )该操作会返回以下文件 {_id : {min : NumberDecimal(76.04),max : NumberDecimal(159.00)},count : 2 } {_id : {min : NumberDecimal(159.00),max : NumberDecimal(199.99)},count : 2 } {_id : {min : NumberDecimal(199.99),max : NumberDecimal(385.00)},count : 2 } {_id : {min : NumberDecimal(385.00),max : NumberDecimal(483.00)},count : 2 }多面聚合 …。 可在$facet阶段内使用$bucketAuto对输入文档artwork进行多个聚合管道处理。 下面的聚合管道根据price、year和area将artwork 中的文档分组 db.artwork.aggregate( [{$facet: {price: [{$bucketAuto: {groupBy: $price,buckets: 4}}],year: [{$bucketAuto: {groupBy: $year,buckets: 3,output: {count: { $sum: 1 },years: { $push: $year }}}}],area: [{$bucketAuto: {groupBy: {$multiply: [ $dimensions.height, $dimensions.width ]},buckets: 4,output: {count: { $sum: 1 },titles: { $push: $title }}}}]}} ] )操作返回以下内容 {area : [{_id : { min : 432, max : 500 },count : 3,titles : [The Scream,The Persistence of Memory,Blue Flower]},{_id : { min : 500, max : 864 },count : 2,titles : [Dancer,The Pillars of Society]},{_id : { min : 864, max : 1568 },count : 2,titles : [The Great Wave off Kanagawa,Composition VII]},{_id : { min : 1568, max : 1568 },count : 1,titles : [Melancholy III]}],price : [{_id : { min : NumberDecimal(76.04), max : NumberDecimal(159.00) },count : 2},{_id : { min : NumberDecimal(159.00), max : NumberDecimal(199.99) },count : 2},{_id : { min : NumberDecimal(199.99), max : NumberDecimal(385.00) },count : 2 },{_id : { min : NumberDecimal(385.00), max : NumberDecimal(483.00) },count : 2}],year : [{ _id : { min : null, max : 1913 }, count : 3, years : [ 1902 ] },{ _id : { min : 1913, max : 1926 }, count : 3, years : [ 1913, 1918, 1925 ] },{ _id : { min : 1926, max : 1931 }, count : 2, years : [ 1926, 1931 ] }] }
http://www.hkea.cn/news/14279253/

相关文章:

  • 可拖拽 网站建设ptp网站开发
  • 海口市网站建设免费制作模卡app的软件
  • 四线城市做网站建设怎么样网站建设需要什么研究条件
  • 东莞市主营网站建设平台网络推广培训机构排名深圳
  • 网站内容与功能设计中山 在门户网站推广
  • 什么作为国内的主要门户网站wordpress 好不好
  • 能上国外网站的免费dns方庄网站建设
  • 番禺网站建设技术九江网站建设优化
  • 珠海做网站的公司介绍渭南 网站建设
  • 电子类网站建设需要多少钱南通市住房和建设局网站
  • 宣化网站制作公司wordpress瀑布式导航
  • 手机网站开通微信支付对电子商务网站建设的认识
  • 建设银行的财务网站企业网站建设一般原则
  • 织梦通用企业网站模板江苏省建设部网站
  • 网络网站维护费怎么做会计分录创建一个自己的公司英语
  • 企业网站访问量的第一来源是( )php做投票网站
  • 中山中小企业网站制作茶山网站仿做
  • 电子商城网站建设与维护学做网站是什么
  • 家装设计网站怎么做.net网站开发实站
  • 代码素材网站哪个好上海建设电动车官方网站
  • 学校网站群建设方案个人养老保险缴费标准
  • 个人的网站怎么备案猪八戒网站建设
  • 网站建设首选-云端高科html5 微网站模版
  • 南京专业网站优化公司如何选择网站公司
  • 视频聚合网站怎么做不侵权目前在哪个平台做推广好
  • 现在做个企业网站一般多少钱企业网站管理系统最新4湖南岚鸿牛x1 0
  • wordpress迁移网站效果好企业营销型网站建设公司
  • 网站建设网站定制dedecms怎么把一个网站的文章导出导到另一个站里
  • 网站售价国家优化防控措施
  • 画流程图的网站怎么选择手机网站建设