"SequoiaDB Giant Sequoia Database" limit() Overview 2

return value

The cursor that returns the result set.

error

Exception is thrown if an error, and outputs an error message via getLastErrMsg () Gets error message or by getLastError () to get the error code. For error handling, please refer to the common error handling guide .

For common errors, please refer to error codes .

Example

Select the records whose age field value is greater than 10 in the collection employee (for example, use the  $gt  query), and only return the first 2 records.

db.sample.employee.find( { age: { $gt: 10 } } ).limit( 2 )
{
  "_id": {
    "$oid": "5813035cc842af52b6000009"
  },
  "name": "Tom",
  "age": 11
}
{
  "_id": {
    "$oid": "58130372c842af52b600000a"
  },
  "name": "Jack",
  "age": 12
}

Click on Jushan Database Documentation Center for more information

Guess you like

Origin blog.csdn.net/weixin_45890253/article/details/113109172