MongoDb multi-set paging query-php Tutorial

Source: Internet
Author: User
MongoDb stores two collections, which have the same structure. Currently, you need to perform paging queries. MongoDb does not support Join-like functions and cannot perform data merging and sorting. Considering using PHP for this feature, we are worried about performance and speed. Ask if there are other... two collections are stored in MongoDb, and the two collections have the same structure.
Currently, you need to perform paging queries. MongoDb does not support Join-like functions and cannot perform data merging and sorting.

Considering using PHP for this feature, we are worried about performance and speed.

Is there any other method? thank you.

Reply content:

MongoDb stores two collections, which have the same structure.
Currently, you need to perform paging queries. MongoDb does not support Join-like functions and cannot perform data merging and sorting.

Considering using PHP for this feature, we are worried about performance and speed.

Is there any other method? thank you.

Although there are other methods, such as directly executing js on mongo to directly filter out unwanted data on the server to reduce the amount of data transferred, it is always a cure.

Like mysql, the join operation should not work in principle. I can only regret that I didn't put it together.

P.S. mysql joins two tables in the memory/out-of-memory storage for both queries and sort at the same time, but this logic is completed by mysqld itself, which is reliable and faster, therefore, it is essentially the same as mongo's remote execution of js. if the table structure cannot be changed, you can write JavaScript with peace of mind.

You can encapsulate a class and sort it by yourself, with average efficiency.
For reference: http://www.cnblogs.com/xinghebuluo/archive/2013/05/29/3105479.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.