mongoose中的流查询stream query,功能类似于php中的mysql_fetch_array,每次从集合中获取一条记录(文档)

1 var cursor = Person.find({ occupation: /host/ }).cursor();
2 cursor.on('data', function(doc) {
3   // Called once for every document
4 });
5 cursor.on('close', function() {
6   // Called when done
7 });

 

相关文章:

  • 2022-01-22
  • 2022-12-23
  • 2022-12-23
  • 2021-11-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-13
  • 2022-03-03
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-25
  • 2021-12-28
  • 2022-12-23
相关资源
相似解决方案