简体   繁体   中英

Request, with limit(results) in mongodb with curl at php

Perfectly i make the request and im getting the response. But i want to inject the "LIMIT" keyword at my query. At this moment my query is

'{"_id":"'.$id.'"}'

I also try this, and many random tries at this format

{"_id":"'.$id.'","limit":"6"}

With this i get all the rows. How and where can i inject the "Limit" MySQL's functionality keyword ? Note that i use GenieacsApi and i make a CURL request with unirest api. If you want more inforamtion. Please comment and i will provide them.

After reading the documentation of GeniacsApi I don't think you can limit results.

Apparently, GeniacsApi only allows raw queries and the "limit" functionality is a stage of the aggregation framework , not of the querying part.

If you cannot use the aggregation framework either the mongo client directly I don't think you can do it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM