使用嵌套子文档的$ unwind(Using $unwind with nested subdocuments)

我有一个具有以下结构的集合:

{
   {
     node: 'ST20'
     Ds:{
          699:{
                   TotCM: 300
                   Docsis20: 200
                   Docsis30: 100
              }
          705:{
                   TotCM: 250
                   Docsis20: 150
                   Docsis30: 100
              }

        }
   }
   {
     node: 'ST21'
Ds:{
          651:{
                   TotCM: 200
                   Docsis20: 100
                   Docsis30: 100
              }
          699:{
                   TotCM: 100
                   Docsis20: 0
                   Docsis30: 100
              }

        }
   }
}

如您所见,我有一个代表节点的文档。 每个节点都有不同的通道。 我的目标是看看每个频道有多少个有线电视。 从前面开始,我不知道每个节点中的通道。 所以我希望有这样的东西:

{ node: 'ST20', Ds: 699, TotCM: 300, Docsis20: 200, Docsis30:100 }
{ node: 'ST20', Ds: 705, TotCM: 250, Docsis20: 150, Docsis30:100 }
{ node: 'ST21', Ds: 651, TotCM: 200, Docsis20: 100, Docsis30:100 }
{ node: 'ST21', Ds: 699, TotCM: 100, Docsis20: 0,   Docsis30:100 }

我尝试了以下查询:

db.statsNodos.aggregate(
{ $project: {_id:0,Ds:1,node:1}},
{ $unwind: "$Ds"}
).pretty()

但是我得到了原始文件。 而且,正如您所看到的,它们是嵌套文档而不是文档数组。 也许我不必使用$unwind ,还有另一种方法可以解决这个问题。 你能告诉我吗?


I have a collection with the following structure:

{
   {
     node: 'ST20'
     Ds:{
          699:{
                   TotCM: 300
                   Docsis20: 200
                   Docsis30: 100
              }
          705:{
                   TotCM: 250
                   Docsis20: 150
                   Docsis30: 100
              }

        }
   }
   {
     node: 'ST21'
Ds:{
          651:{
                   TotCM: 200
                   Docsis20: 100
                   Docsis30: 100
              }
          699:{
                   TotCM: 100
                   Docsis20: 0
                   Docsis30: 100
              }

        }
   }
}

As you can see, I have a document that represents a node. Each node, has different channels. My objective is see how many cablemodems I have in each channel. From upfront, I don't know the channels that I have in each node. So I would like to have something like this:

{ node: 'ST20', Ds: 699, TotCM: 300, Docsis20: 200, Docsis30:100 }
{ node: 'ST20', Ds: 705, TotCM: 250, Docsis20: 150, Docsis30:100 }
{ node: 'ST21', Ds: 651, TotCM: 200, Docsis20: 100, Docsis30:100 }
{ node: 'ST21', Ds: 699, TotCM: 100, Docsis20: 0,   Docsis30:100 }

I tried the following query:

db.statsNodos.aggregate(
{ $project: {_id:0,Ds:1,node:1}},
{ $unwind: "$Ds"}
).pretty()

But I get the original document. And, as you can see, they are nested documents and not an array of documents. Maybe I don't have to use $unwind and there is another way to get this. Can you tell me?


原文:https://stackoverflow.com/questions/46286550
2024-04-21 13:04

满意答案

这是因为您需要对click事件应用更改。 因此,您可以添加此代码以在每次单击章节时调整视频大小(您可以添加一些延迟以确保获得正确的大小):

$('ul.nav-tabs a').click(function() {
  setTimeout(function() {
    var vidHeight = $('.video-container').height();
    $('.description').css('height', vidHeight + 'px');
  }, 500);

});

您还可以使用$(document).ready函数,以确保调整大小代码在页面加载时运行良好。

完整代码:

$(document).ready(function() {
  setTimeout(function() {
    var vidHeight = $('.video-container').height();
    $('.description').css('height', vidHeight + 'px');
  }, 500);
  $(window).resize(function() {
    var vidHeight = $('.video-container').height();
    $('.description').css('height', vidHeight + 'px');
  });

  $('ul.nav-tabs a').click(function() {
    setTimeout(function() {
      var vidHeight = $('.video-container').height();
      $('.description').css('height', vidHeight + 'px');
    }, 500);

  });
});
/* Tools */

.no-padding {
  padding: 0!important;
}

.slow-effect {
  transition: all .2s ease-in-out;
  -webkit-transition: all .2s ease-in-out;
}


/* ======================================================================================= */


/* Layout ================================================================================ */

.space {
  height: 50px;
}

.container-fluid {
  padding: 0 4%;
}


/* Global Styles ========================================================================= */


/* Form Elements */


/*start places*/

body {
  height: 2000px;
}

.main-container {
  border: 2px solid #000;
  overflow: hidden;
}

.description {
  background-color: #898989;
  padding: 16px 30px;
  overflow: auto;
}

.description ul {
  margin: 0;
  padding: 0;
}

.description ul li a {
  background-color: #898989;
  color: #fff;
  padding-bottom: 18px;
  margin-bottom: 18px;
  position: relative;
  border: none;
}

.nav-tabs>li>a:hover {
  border: none;
  border-bottom: 2px solid #fff;
  background-color: #fff;
  color: #555555;
}

.description ul li a>h2 {
  font-weight: 700;
  font-size: 35px;
  margin: 0;
}

.description ul li a>p {
  font-size: 18px;
  line-height: 30px;
  margin-top: 5px;
  margin-bottom: 0;
}

.video-container {
  position: relative;
}

.video-container .tools {
  position: absolute;
  width: 100%;
  height: 40px;
  background-color: #a4a4a4;
  left: 0;
  bottom: 0;
  z-index: 999;
}

.video-container:hover .tools {
  visibility: hidden;
}

#style-1::-webkit-scrollbar {
  background-color: #898989;
}

#style-1::-webkit-scrollbar-thumb {
  border-radius: 10px;
  -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);
  background-color: #adadad
}

#style-1::-webkit-scrollbar {
  width: 20px;
}

@media(min-width: 992px) {
  .description {
    border-left: 2px solid #000;
  }
  .description ul li a {
    border-bottom: 2px solid #fff;
  }
}

@media(max-width: 991px) {
  .description {
    border-left: 2px solid #000;
    white-space: nowrap;
    padding: 0;
    height: auto!important;
  }
  .description ul li a {
    display: inline-block;
    width: 34%;
    padding: 14px;
    text-align: left;
    overflow: hidden;
    min-height: 252px;
    white-space: normal;
    vertical-align: text-top;
    margin-bottom: 0;
  }
  .description ul li:after {
    content: "";
    display: inline-block;
    width: 2px;
    height: 170px;
    position: absolute;
    right: 6px;
    top: 20px;
    background-color: #fff;
  }
  .description ul li:last-child:after {
    content: "";
    display: none;
  }
  .description ul li a>h2 {
    font-size: 22px;
  }
  .description ul li a>p {
    font-size: 14px;
    line-height: 23px;
  }
}

@media screen and (min-width: 220px) and (max-width: 550px) {
  .description ul li a {
    padding: 8px;
    min-height: 200px;
  }
  .description ul li a h2 {
    font-size: 14px;
  }
  .description ul li a p {
    font-size: 10px;
    line-height: 16px;
  }
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div class="container-fluid">
  <div class="row">
    <div class="space"></div>
    <div id="exTab2" class="col-xs-12 no-padding main-container">
      <div class="col-md-9 no-padding video-container tab-content">
        <div id="1" class="tabs-container tab-pane fade in active">
          <!-- Item-1 -->
          <div class="tools slow-effect"></div><video controls="" width="100%"><source src="https://www.w3schools.com/html/mov_bbb.mp4" type="video/mp4"> <source src="test.ogg" type="video/ogg"> Your browser does not support HTML5 video.</video>
        </div>
        <div id="2" class="tabs-container tab-pane fade">
          <!-- Item-2 -->
          <div class="tools slow-effect"></div><video controls="" width="100%"><source src="https://www.w3schools.com/html/movie.mp4" type="video/mp4"> <source src="mov_bbb.ogg" type="video/ogg"> Your browser does not support HTML5 video.</video>
        </div>
        <div id="3" class="tabs-container tab-pane fade">
          <!-- Item-3 -->
          <div class="tools slow-effect"></div><video controls="" width="100%"><source src="movie.mp4" type="video/mp4"> <source src="movie.ogg" type="video/ogg"> Your browser does not support HTML5 video.</video>
        </div>
        <div id="4" class="tabs-container tab-pane fade">
          <!-- Item-4 -->
          <div class="tools slow-effect"></div><video controls="" width="100%"><source src="test.WEBM" type="video/mp4"> <source src="test.ogg" type="video/ogg"> Your browser does not support HTML5 video.</video>
        </div>
      </div>
      <!-- Item-2 -->
      <div class="col-md-3 description" id="style-1">
        <ul class="nav nav-tabs">
          <li class="active">
            <a data-toggle="tab" href="#1">
              <h2>Chapter 1</h2>
              <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. A non velit, illo vel neque sunt doloremque incidunt.</p>
            </a>
          </li>
          <li>
            <a data-toggle="tab" href="#2">
              <h2>Chapter 2</h2>
              <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. A non velit, illo vel neque sunt, rerum doloremque incidunt laudantium aliquid itaque cum error nobis.</p>
            </a>
          </li>
          <li>
            <a data-toggle="tab" href="#3">
              <h2>Chapter 3</h2>
              <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. A non velit.</p>
            </a>
          </li>
          <li>
            <a data-toggle="tab" href="#4">
              <h2>Chapter 4</h2>
              <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. A non velit, illo vel neque sunt, rerum doloremque incidunt laudantium aliquid itaque.</p>
            </a>
          </li>
        </ul>
      </div>
    </div>
  </div>
</div>


It's because you need to apply the change on the click event. So you may add this code to resize the video each time you click on a chapter (you may add some delay to be sure you get the correct size) :

$('ul.nav-tabs a').click(function() {
  setTimeout(function() {
    var vidHeight = $('.video-container').height();
    $('.description').css('height', vidHeight + 'px');
  }, 500);

});

You may also use $(document).ready function in order to be sure the resize code works well at page load.

Full code :

$(document).ready(function() {
  setTimeout(function() {
    var vidHeight = $('.video-container').height();
    $('.description').css('height', vidHeight + 'px');
  }, 500);
  $(window).resize(function() {
    var vidHeight = $('.video-container').height();
    $('.description').css('height', vidHeight + 'px');
  });

  $('ul.nav-tabs a').click(function() {
    setTimeout(function() {
      var vidHeight = $('.video-container').height();
      $('.description').css('height', vidHeight + 'px');
    }, 500);

  });
});
/* Tools */

.no-padding {
  padding: 0!important;
}

.slow-effect {
  transition: all .2s ease-in-out;
  -webkit-transition: all .2s ease-in-out;
}


/* ======================================================================================= */


/* Layout ================================================================================ */

.space {
  height: 50px;
}

.container-fluid {
  padding: 0 4%;
}


/* Global Styles ========================================================================= */


/* Form Elements */


/*start places*/

body {
  height: 2000px;
}

.main-container {
  border: 2px solid #000;
  overflow: hidden;
}

.description {
  background-color: #898989;
  padding: 16px 30px;
  overflow: auto;
}

.description ul {
  margin: 0;
  padding: 0;
}

.description ul li a {
  background-color: #898989;
  color: #fff;
  padding-bottom: 18px;
  margin-bottom: 18px;
  position: relative;
  border: none;
}

.nav-tabs>li>a:hover {
  border: none;
  border-bottom: 2px solid #fff;
  background-color: #fff;
  color: #555555;
}

.description ul li a>h2 {
  font-weight: 700;
  font-size: 35px;
  margin: 0;
}

.description ul li a>p {
  font-size: 18px;
  line-height: 30px;
  margin-top: 5px;
  margin-bottom: 0;
}

.video-container {
  position: relative;
}

.video-container .tools {
  position: absolute;
  width: 100%;
  height: 40px;
  background-color: #a4a4a4;
  left: 0;
  bottom: 0;
  z-index: 999;
}

.video-container:hover .tools {
  visibility: hidden;
}

#style-1::-webkit-scrollbar {
  background-color: #898989;
}

#style-1::-webkit-scrollbar-thumb {
  border-radius: 10px;
  -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);
  background-color: #adadad
}

#style-1::-webkit-scrollbar {
  width: 20px;
}

@media(min-width: 992px) {
  .description {
    border-left: 2px solid #000;
  }
  .description ul li a {
    border-bottom: 2px solid #fff;
  }
}

@media(max-width: 991px) {
  .description {
    border-left: 2px solid #000;
    white-space: nowrap;
    padding: 0;
    height: auto!important;
  }
  .description ul li a {
    display: inline-block;
    width: 34%;
    padding: 14px;
    text-align: left;
    overflow: hidden;
    min-height: 252px;
    white-space: normal;
    vertical-align: text-top;
    margin-bottom: 0;
  }
  .description ul li:after {
    content: "";
    display: inline-block;
    width: 2px;
    height: 170px;
    position: absolute;
    right: 6px;
    top: 20px;
    background-color: #fff;
  }
  .description ul li:last-child:after {
    content: "";
    display: none;
  }
  .description ul li a>h2 {
    font-size: 22px;
  }
  .description ul li a>p {
    font-size: 14px;
    line-height: 23px;
  }
}

@media screen and (min-width: 220px) and (max-width: 550px) {
  .description ul li a {
    padding: 8px;
    min-height: 200px;
  }
  .description ul li a h2 {
    font-size: 14px;
  }
  .description ul li a p {
    font-size: 10px;
    line-height: 16px;
  }
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div class="container-fluid">
  <div class="row">
    <div class="space"></div>
    <div id="exTab2" class="col-xs-12 no-padding main-container">
      <div class="col-md-9 no-padding video-container tab-content">
        <div id="1" class="tabs-container tab-pane fade in active">
          <!-- Item-1 -->
          <div class="tools slow-effect"></div><video controls="" width="100%"><source src="https://www.w3schools.com/html/mov_bbb.mp4" type="video/mp4"> <source src="test.ogg" type="video/ogg"> Your browser does not support HTML5 video.</video>
        </div>
        <div id="2" class="tabs-container tab-pane fade">
          <!-- Item-2 -->
          <div class="tools slow-effect"></div><video controls="" width="100%"><source src="https://www.w3schools.com/html/movie.mp4" type="video/mp4"> <source src="mov_bbb.ogg" type="video/ogg"> Your browser does not support HTML5 video.</video>
        </div>
        <div id="3" class="tabs-container tab-pane fade">
          <!-- Item-3 -->
          <div class="tools slow-effect"></div><video controls="" width="100%"><source src="movie.mp4" type="video/mp4"> <source src="movie.ogg" type="video/ogg"> Your browser does not support HTML5 video.</video>
        </div>
        <div id="4" class="tabs-container tab-pane fade">
          <!-- Item-4 -->
          <div class="tools slow-effect"></div><video controls="" width="100%"><source src="test.WEBM" type="video/mp4"> <source src="test.ogg" type="video/ogg"> Your browser does not support HTML5 video.</video>
        </div>
      </div>
      <!-- Item-2 -->
      <div class="col-md-3 description" id="style-1">
        <ul class="nav nav-tabs">
          <li class="active">
            <a data-toggle="tab" href="#1">
              <h2>Chapter 1</h2>
              <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. A non velit, illo vel neque sunt doloremque incidunt.</p>
            </a>
          </li>
          <li>
            <a data-toggle="tab" href="#2">
              <h2>Chapter 2</h2>
              <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. A non velit, illo vel neque sunt, rerum doloremque incidunt laudantium aliquid itaque cum error nobis.</p>
            </a>
          </li>
          <li>
            <a data-toggle="tab" href="#3">
              <h2>Chapter 3</h2>
              <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. A non velit.</p>
            </a>
          </li>
          <li>
            <a data-toggle="tab" href="#4">
              <h2>Chapter 4</h2>
              <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. A non velit, illo vel neque sunt, rerum doloremque incidunt laudantium aliquid itaque.</p>
            </a>
          </li>
        </ul>
      </div>
    </div>
  </div>
</div>

相关问答

更多

jQuery wookmark插件动态div高度(jQuery wookmark plugin dynamic div height)

这个插件的作者。 Github存储库包含如何处理这种情况的示例。 保持对应用布局的选择器的引用,然后您可以稍后再次调用wookmark函数来手动更新布局。 检查存储库中“example”文件夹中的“ index.html ”以查看代码。 Author of the plugin here. The Github repository contains an example of how to handle this situation. Keep a reference to the select...

动态iframe高度与css或jquery(Dynamic iframe height with css or jquery)

在其载荷上更改iframe的高度: $("#the_iframe").load(function() { $(this).height( $(this).contents().find("body").height() ); }); 演示 Change the height of iframe on its load: $("#the_iframe").load(function() { $(this).height( $(this).contents().find("body").h...

jquery动画动态高度div(jquery animating dynamic height div)

为什么不使用完全符合要求的slideUp()和slideDown()方法? 或者更好的是还是自动处理这两种方式的slideToggle() ? $(document).ready(function(e) { // vars var question = $('#faqQues'); var answer = $('#faqAns'); var ansCont = $('#faqAnsCont'); question.click(function() { ...

动态高度问题(Dynamic height issue)

简单的错误。 您似乎已经忘记在此代码中添加%符号,您还应该将宽度和高度更改为最小宽度和最小高度: .slide { top: 0; opacity: 0; width: 100; height: 100; display: block; position: absolute; transform: scale(1); transition: all .7s ease-in-out; } 所以把它变成这样: .slide { top: 0; opacity: 0; min-width: 100...

jQuery将div的高度设置为另一个的“动态高度”(jQuery set height of a div to the 'dynamic height' of another)

这对我来说很好,只是你的类名错误,类名应该是.col-1和.col-2 : $(document).ready(function() { var divHeight = $('.col-1').height(); $('.col-2').css('min-height', divHeight+'px'); }); 这是小提琴 编辑 - 基于评论: 你可以做所有这些,而不使用jQuery Flexbox (在IE 8和9中不支持) - 如果将flex应用到父级div,它将使所...

Jquery smoothscroll vs动态高度(Jquery smoothscroll vs dynamic height)

嗡嗡声,我们离开的想法! 如果问题是位置改变,那么将滚动绑定到一个元素而不是固定像素; 让我们说你的菜单中有一个我不知道的按钮,类:'menu-item': 假设 <img class="menu-item" data-target="#my-target-selector"/> 所以: var menuSelector menuSelector = $('.menu-item'); menuSelector.on('click', function(event){ event.pre...

动态UITableCellView高度(Dynamic UITableCellView height)

我下载了你在GitHub上创建的项目并进行了一些更改并使其正常工作。 ViewController中的代码如下所示...... import UIKit class MyTableViewController: UITableViewController { var entries:Array<String> = [String]() override func viewDidLoad() { super.viewDidLoad() var ...

动态容器高度(仅限jQuery)(Dynamic Container Height (jQuery Only))

您可以使用resize事件 ,如下所示:(未经测试) var expandingDiv = $('...'); $(window).resize(function(e) { expandingDiv.height(document.documentElement.clientHeight - (180 + 50)); }); You can use the resize event, like this: (untested) var expandingDiv = $('...'); $...

JQuery动态高度问题(JQuery dynamic height issue)

这是因为您需要对click事件应用更改。 因此,您可以添加此代码以在每次单击章节时调整视频大小(您可以添加一些延迟以确保获得正确的大小): $('ul.nav-tabs a').click(function() { setTimeout(function() { var vidHeight = $('.video-container').height(); $('.description').css('height', vidHeight + 'px'); }, 500);...

如何在类中设置动态高度:在使用jquery之前?(how to set dynamic height in class:before using jquery?)

我解决了这个问题 设置高度100vh i was solved this problem set height 100vh

相关文章

更多

spring 嵌套事务 的 加锁 问题

有两个service:ServiceA 和 ServiceB ServiceA { metho ...

怎么递归json嵌套json?

比如JSONObject: {&quot;temp1&quot;:{&quot;b&quot;:&q ...

EL 表达式 嵌套问题

${'read_'+${tmodule.tid}} 各位大牛 如何解决这个问题的

ExtJS3.2,在FormPanel中嵌套TabPanel和GridPanel后无法正常显示

原本在没有添加FormPanel的情况下可以正常显示,但添加FormPanel后就无法正常显示页面布局 ...

谁有sap的相关文档

谁有sap的相关文档

在线文档显示打印

哪位见过这种类型的在线文档显示打印,是用什么插件做的 问题补充:j2ee中有没有类似的插件

Solr添加文档到索引

solr添加文档非常方便,不用像Lucene那样一个一个添加Field,省去了很多的麻烦下面看操作 方 ...

Java 文档注释

Java 文档注释 Java只是三种注释方式。前两种分别是// 和/* */,第三种被称作说明 ...

Python解析XML文档

解析XML主要用到pytohn自带的XML库,其次还是lxml库 XML结构,先以一个相对简单但功能 ...

微信前景与范围文档

微信 前景与范围文档 1.业务需求 1.1应用背景 由于现在的独生子女较多和社会的多元化发展,维持社会 ...

最新问答

更多

python的访问器方法有哪些

使用方法: class A(object): def foo(self,x): #类实例方法 print "executing foo(%s,%s)"%(self,x) @classmethod def class_foo(cls,x): #类方法 print "executing class_foo(%s,%s)"%(cls,x) @staticmethod def static_foo(x): #静态方法 print "executing static_foo(%s)"%x调用方法: a =

使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)

我认为你必须将两个TableGetway传递给UserTable构造。 你必须改变Module.php看看: public function getServiceConfig() { return array( 'factories' => array( 'User\Model\UserTable' => function($sm) { $userTableGateway = $sm->get('UserTable

透明度错误IE11(Transparency bug IE11)

这是一个渲染错误,由使用透明度触发,使用bootstrap用于在聚焦控件周围放置蓝色光环的box-shadow属性。 可以通过添加以下类覆盖来解决它。 .form-control:hover { -webkit-box-shadow: 0px 0px 5px 0px rgba(0,0,255,1); -moz-box-shadow: 0px 0px 5px 0px rgba(0,0,255,1); box-shadow: 0px 0px 4px 0px rgba(0,0,255,1)

linux的基本操作命令。。。

ls 显示目录 mkdir 建立目录 cd 进入目录

响应navi重叠h1和nav上的h1链接不起作用(Responsive navi overlaps h1 and navi links on h1 isn't working)

将z-index设置为.main-nav这将解决您的重叠问题 .main-nav { position:relative; z-index:9; } set z-index to .main-nav This will fix your overlaping issue .main-nav { position:relative; z-index:9; }

在C中读取文件:“r”和“a +”标志的不同行为(Reading a File in C: different behavior for “r” and “a+” flags)

这是因为模式规范"a"打开一个文件以便追加,文件指针在末尾。 如果您尝试从此处读取,则由于文件指针位于EOF,因此没有数据。 您应该打开"r+"进行阅读和写作。 如果在写入之前读取整个文件,则在写入更多数据时,文件指针将正确定位以追加。 如果这还不够,请探索ftell()和fseek()函数。 That is because the mode spec "a" opens a file for appending, with the file pointer at the end. If you

NFC提供什么样的带宽?(What Kind of Bandwidth does NFC Provide?)

支持空中接口的数据速率是一回事。 在消除协议开销,等待eeprom写入以及所有需要时间的其他内容之后,您看到的数据速率是完全不同的故事。 长话短说,从标签读取或进行对等传输时的实际数据速率峰值约为2.5千字节/秒。 取决于具体的标签或对等技术,它可能比这慢很多。 The supported data-rates of the air-interface are one thing. The data-rate that you see after removing protocol overhe

元素上的盒子阴影行为(box-shadow behaviour on elements)

它看起来像只在Windows上的Chrome的错误。 我在Google Canary (Chrome 63)中也进行了测试,问题依然存在,所以有可能它不会很快修复。 这个问题是由overflow: auto引起的overflow: auto ,在你的情况下,它可以很容易地通过删除或设置为可见(默认)来解决。 但是 ,将鼠标悬停在右侧(顶部和底部)时,会出现滚动条。 一个解决方案可以设置overflow: hidden的身体,所以预期的结果是所需的。 我想指出,这不是一个很好的解决方案,但我建议暂

Laravel检查是否存在记录(Laravel Checking If a Record Exists)

这取决于您是否要以后与用户合作,或仅检查是否存在。 如果要使用用户对象(如果存在): $user = User::where('email', '=', Input::get('email'))->first(); if ($user === null) { // user doesn't exist } 如果你只想检查 if (User::where('email', '=', Input::get('email'))->count() > 0) { // user found

设置base64图像的大小javascript - angularjs(set size of a base64 image javascript - angularjs)

$scope.getData= function () { var reader = new FileReader(); reader.onload = $('input[type=file]')[0].files; var img = new Image(); img.src =(reader.onload[0].result); img.onload = function() { if(this.width > 640