当前位置:网站首页>Mongodb paging method
Mongodb paging method
2022-06-29 06:10:00 【icestone_ kai】
Paging method
cursor.limit(): How many documents
cursor.skip() : How many documents to skip
Example
//var cursor = db.person.find()
// demand : It is required that before taking out 5 A document
//cursor.limit(5)
// demand : Ask to skip the previous 5 A document , Take out all the remaining
//cursor.skip(5)
// Be careful : We can go straight to find Called after method limit Methods or skip Method
//db.person.find().limit(5)
//db.person.find().skip(5)
###### Pay attention to paging functions
// Be careful : MongoDB It supports chain call
// demand : Skip the front 5 A document , Take out the back one 5 A document
//db.person.find().skip(5).limit(5)
// Be careful : In the chain call , No matter what skip Before or after , Will be in limit Before execution
db.person.find().limit(5).skip(10)
//var cuesor=db.person.find()
// demand : It is required to take out the first five pieces of data :
//cursor.limit(5)
// demand : Ask to skip the previous five documents , Take out the remaining documents
//cuesor.skip(5)
// Be careful : We can do it in find Call back limit/skip Method
//db.person.find().limit(5)
//db.person.find().skip(5)
// Be careful :mongodb It supports chain call
// demand : Skip the front 5 Documents , Take out the next five documents :
db.person.find().skip(5).limit(5)
// Be careful : In the chain call , No matter what skip Before or after , Will be in limit Before execution
边栏推荐
- 2022 recommended cloud computing industry research report investment strategy industry development prospect market analysis (the attachment is a link to the online disk, and the report is continuously
- Ctrip launched the "3+2" office mode. Are you sour?
- Sourcetree remote red exclamation point
- Output various graphics and text on the console through C #
- After nine years of testing, the salary for interviewing Huawei is 10000. Huawei employees: the company doesn't have such a low salary position
- Sum of digits under k-ary representation of leetcode simple problem
- Week 12 - task 2- shoulder to shoulder cadres
- Internet enterprises need CRM software to help
- Review of MySQL knowledge points
- 2-nitro-5,10,15,20-tetra (3,5-dimethoxyphenyl) porphyrin (no2tdmpp) H2) /5,10,15,20-tetra (4-methylphenyl) porphyrin (TMPP) H2) Qiyue porphyrin products
猜你喜欢

What are the uses of wireless pressure collectors?

2022 recommended tire industry research report industry development prospect market analysis white paper

Installing modules in pycharm

What has urbanization brought to our mental health and behavior?

Testing grpc service with grpcui

2022 recommended high-speed rail industry research report investment strategy industry development prospect market analysis (the attachment is a link to the online disk, and the report is continuously

Design of leetcode simple problem goal parser

Creation of Arduino uno development environment

Hustoj SPJ example

Research Report on the new energy industry of recommended power equipment in 2022 industry development prospect market investment analysis (the attachment is a link to the network disk, and the report
随机推荐
2022.02.14
Rearrangement string of leetcode simple question
JS messagechannel transport
HTTP Caching Protocol practice
Would like to ask, which is the better choice for securities companies? I don't understand. Is it safe to open an account online now?
Honeypot based on MySQL load data local INFILE
Meta metauniverse female safety problems occur frequently. How to solve the relevant problems in the metauniverse?
Will the order of where conditions in MySQL affect the union index? Will where 1 =1 affect the use of the index? Does where 1 =1 affect the use of indexes?
51 single chip microcomputer learning notes 7 -- Ultrasonic Ranging
ICLR is going to have a big discussion on the deep generation model. Max welling and the winner of the AAAI million dollar award are here. Bengio is one of the organizers
2022 recommended quantum industry research industry development planning prospect investment market analysis report (the attachment is a link to the online disk, and the report is continuously updated
Hyperledger Fabric 2. X custom smart contract
2022.02.15
2,5-di (3,4-dicarboxyphenoxy) - 4 '- phenylethynylbiphenyldianhydride (pephqda) / Qiyue custom supply porphyrin modified amphiphilic block copolymer peg113-pcl46-porphyrin
Embedded RTOS
Go compile source code (window environment)
Is there any difference between a=a+b and a+=b?
There are two ways for golang to develop mobile applications
(practice C language every day) matrix
想问问,券商选哪个比较好尼?本人小白不懂,现在网上开户安全么?