您的位置:首页 > 博客中心 > 数据库 >

【MongoDB】The high query operation of MongoDB(三)

时间:2022-03-14 00:08

1, Sort 

Needless to say, mongodb also support to sort data. THe positive one means sorting by asc order and negetive means by desc.

gxlsystem.com,布布扣

2. Group

The grammar of group:

gxlsystem.com,布布扣

Description Of Argument:

key: The field need to group 

cond: query condition 

Initial: initialize the counter of group

Redue: generally statistic operation

Finalize: further operation after group, for exampe calcuate the average. 

3.gxlsystem.com,布布扣

3. Distinct

it‘s the same as the distinct in the relational database.

gxlsystem.com,布布扣


4. page

The mongodb supports to use skip and limit to query by page.

gxlsystem.com,布布扣


5. Cursors and Cursor Methods

gxlsystem.com,布布扣


6. $query/$orderby/$explain

gxlsystem.com,布布扣


热门排行

今日推荐

热门手游