Old | New | |
1 | 1 | |
---|
| 2 | = limit() = |
---|
| 3 | ---- |
---|
| 4 | [[MongoDB Driver Function Reference]] |
---|
| 5 | |
---|
| 6 | |
---|
| 7 | Restricts the number of rows returned. |
---|
| 8 | More information can be found in the corresponding entry of the [[https://docs.mongodb.com/manual/reference/method/cursor.limit/index.html|MongoDB Manual]]. |
---|
| 9 | |
---|
| 10 | |
---|
| 11 | [[[@cG |
---|
| 12 | |
---|
| 13 | <cursor>.limit(<number>) |
---|
| 14 | |
---|
| 15 | ]]] |
---|
| 16 | |
---|
| 17 | |
---|
| 18 | **Arguments** |
---|
| 19 | |
---|
| 20 | [[[@w |
---|
| 21 | |
---|
| 22 | |@t0@r0@c0 <cursor> | | A result set. | |
---|
| 23 | | <number> | | Maximum number of rows to return. | |
---|
| 24 | |
---|
| 25 | ]]] |
---|
| 26 | |
---|
| 27 | |
---|
| 28 | **Returns** |
---|
| 29 | |
---|
| 30 | [[[@w |
---|
| 31 | |
---|
| 32 | Returns a result set (cursor). |
---|
| 33 | |
---|
| 34 | ]]] |
---|
| 35 | |
---|
| 36 | |
---|
| 37 | **Example** |
---|
| 38 | |
---|
| 39 | [[[@cw |
---|
| 40 | |
---|
| 41 | db.employees.find().limit(10); |
---|
| 42 | |
---|
| 43 | ]]] |
---|
| 44 | |
---|
| 45 | Returns a maximum of ten documents from the //employee// collection. |
---|
| 46 | |
---|
| 47 | |
---|
| 48 | |
---|
| 49 | |
---|
| 50 | ---- |
---|
| 51 | [[Main|home]] | [[MongoDB Driver Function Reference]] | [[MongoDB Driver]] |
---|
| 52 | |
---|