当前位置:网站首页>Sort and projection
Sort and projection
2022-07-05 20:17:00 【Why not sell egg cakes well】
14 sort And projection
// When querying documents , The default in accordance with the id Values
db.emp.find({});
//sort Used to specify the collation of documents
db.emp.find({}).sort({sal:1});
// Descending
db.emp.find({}).sort({sal:-1});
db.emp.find({}).sort({sal:1,empno:-1});
// When inquiring , You can set the query result at the second parameter , Projection
db.emp.find({},{ename:1,_id=0,sal=1});
limit/skip/sort The calling order is independent of the writing order .
边栏推荐
- .Net分布式事務及落地解决方案
- CTF逆向基础
- 字节跳动Dev Better技术沙龙成功举办,携手华泰分享Web研发效能提升经验
- 【数字IC验证快速入门】1、浅谈数字IC验证,了解专栏内容,明确学习目标
- A solution to PHP's inability to convert strings into JSON
- A way to calculate LNX
- What is PyC file
- Go language learning tutorial (16)
- ICTCLAS用的字Lucene4.9捆绑
- 信息学奥赛一本通 1337:【例3-2】单词查找树 | 洛谷 P5755 [NOI2000] 单词查找树
猜你喜欢
Leetcode: binary tree 15 (find the value in the lower left corner of the tree)
Zero cloud new UI design
Build your own website (16)
JVMRandom不可设置种子|问题追溯|源码追溯
About the priority of Bram IP reset
leetcode刷题:二叉树17(从中序与后序遍历序列构造二叉树)
leetcode刷题:二叉树11(平衡二叉树)
如何形成规范的接口文档
Mysql频繁操作出现锁表问题
[quick start of Digital IC Verification] 7. Basic knowledge of digital circuits necessary for verification positions (including common interview questions)
随机推荐
E. Singhal and Numbers(质因数分解)
Wechat applet regular expression extraction link
CADD课程学习(7)-- 模拟靶点和小分子相互作用 (半柔性对接 AutoDock)
Guidelines for application of Shenzhen green and low carbon industry support plan in 2023
2020 CCPC 威海 - A. Golden Spirit(思维),D. ABC Conjecture(大数分解 / 思维)
基础篇——配置文件解析
信息学奥赛一本通 1337:【例3-2】单词查找树 | 洛谷 P5755 [NOI2000] 单词查找树
【数字IC验证快速入门】3、数字IC设计全流程介绍
Mysql频繁操作出现锁表问题
解决php无法将string转换为json的办法
document方法
Minimum commission for stock trading account opening, where to open an account with low commission? Is it safe to open an account on your mobile phone
.Net分布式事務及落地解决方案
618 "low key" curtain call, how can baiqiushangmei join hands with the brand to cross the "uncertain era"?
Leetcode: binary tree 15 (find the value in the lower left corner of the tree)
14. Users, groups, and permissions (14)
kubernetes资源对象介绍及常用命令(五)-(ConfigMap&Secret)
ICTCLAS word Lucene 4.9 binding
怎么挑选好的外盘平台,安全正规的?
Cocos2d-x项目总结中的一些遇到的问题