MongoDB_记录条数limit和跳过条数skip
来源:互联网 发布:mysql数据表关联字段 编辑:程序博客网 时间:2024/06/02 16:30
'use strict';// connect MongoDBvar mongodb = require("mongodb");var server = new mongodb.Server("127.0.0.1", 27017, {auto_reconnect:true});var client = new mongodb.Db("testDB", server, {w:1});client.open(function(err, db){ if (err) { throw err; } else { db.collection("testTable", {safe:true}, function(err, collection){ if (err) { throw err; } else { // 全部查找 collection.find().toArray(function(err, result){ //JsonLog(result); }); // 读取记录条数 limit查找 //collection.find({}, {name:1, _id:0}).limit(2).toArray(function(err, result){ // JsonLog(result); //}); // 跳过记录条数 skip查找 collection.find({}, {age:1, _id:0}).skip(2).toArray(function(err, result){ JsonLog(result); }); } }); }});
0 0
- MongoDB_记录条数limit和跳过条数skip
- 限制记录条数
- mysql update limit 限制更新条数
- sql ---获取记录条数
- Hql获取记录条数
- ResultSet获取记录条数
- sql 查询记录条数
- mybatis查询记录条数
- hibernate+spring 取记录条数方法
- hibernate获取记录条数的方法
- 求GridView的记录条数
- hibernate查询记录条数返回类型
- yii计算数据库的记录条数
- HQL自己设置显示记录条数
- 统计表记录条数的方法比较
- mysql 随机获取记录条数
- sql语句,限制返回记录条数
- 查询指定条数的记录
- hdu1811 Rank of Tetris(待解决 拓扑排序)
- STM32Cube MicroXplorer
- 来年春天
- 关于编译MPFR遇到的GMP版本问题
- 推荐系统和搜索引擎的关系
- MongoDB_记录条数limit和跳过条数skip
- Swift - 界面跳转,传值
- 局部光照模型及其BRDF
- python教程2 安装使用 pycharm
- poj2115
- 搭建个人页面的笔记
- 三通道图像转化为三通道,并将多通道图像混合
- [BZOJ3261] 最大异或和
- 【XJBG】UESTCdp练习场 D 温泉旅馆