当前位置:网站首页>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
边栏推荐
- It turns out that the joys and sorrows of programmers are not interlinked
- Leetcode theme [array] -217- there are duplicate elements
- Rich material libraries make modeling easy and efficient for developers
- Jenkins operation Chapter 5 trigger, configuration webhook, Jenkins parameterized construction
- 想问问,券商选哪个比较好尼?本人小白不懂,现在网上开户安全么?
- Use of sed in shell script
- Hyperledger Fabric 2. X custom smart contract
- DANGER! V** caught climbing over the wall!
- β- Tetraphenyl nickel porphyrin with all chlorine substitution| β- Thiocyano tetraphenyl porphyrin copper| β- Dihydroxy tetraphenyl porphyrin 𞓜 2-nitroporphyrin | supplied by Qiyue
- Rearrangement string of leetcode simple question
猜你喜欢

The fresh student who was born in Ali after 2000: it's really fragrant to mend this

HTTP Caching Protocol practice

Ti Click: quickly set up tidb online laboratory through browser | ti- team interview can be conducted immediately

Creation of Arduino uno development environment

Observer mode vs publish subscribe mode

2022 recommended REITs Industry Research Report investment strategy industry development prospect market analysis (the attachment is a link to the online disk, and the report is continuously updated)
![[high concurrency] deeply analyze the callable interface](/img/fb/89ebd5592f1383c8015a47cec78a59.jpg)
[high concurrency] deeply analyze the callable interface

2022 recommended prefabricated construction industry research report industry development prospect market analysis white paper (the attachment is a link to the network disk, and the report is continuo

Slot

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
随机推荐
Parsing rshub document auto generation API
What if the hard disk fails to recognize how to recover data
Longest substring between two identical characters of leetcode simple question
5,10-di (4-aminophenyl) - 15,20-diphenylporphyrin (cis-dadph2) /5,15-di (4-aminophenyl) - 10,20-diphenylporphyrin (trans-dadph2) / (tri-apph2) supplied by Qiyue
Implementation of queue
D Author: import C programming in D
Test Development - ten years of sharpening one sword (VII) interface test tool postman
What are the uses of wireless pressure collectors?
51 lines of code, self-made TX to MySQL software!
5,10,15,20-tetra (3,5-dimethoxyphenyl) porphyrin ((tdmpp) H2) /2-nitro-5,10,15,20-tetra (3,5-dimethoxyphenyl) porphyrin copper (no2tdmpp) Cu) supplied by Qiyue
Activiti Designer
Internet enterprises need CRM software to help
2022 recommended tire industry research report industry development prospect market analysis white paper
Multiline regular expression search in Visual Studio code - multiline regular expression search in Visual Studio code
Leetcode simple problem building arrays with stack operation
(practice C language every day) matrix
2022 recommended prefabricated construction industry research report industry development prospect market analysis white paper (the attachment is a link to the network disk, and the report is continuo
The first commercial spacewalk of mankind is finalized! Musk SpaceX announced a new round of space travel plan, and the American rich became repeat customers
Leetcode theme [array] -217- there are duplicate elements
Slot