Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"count" value equals to "limit" #625

Closed
eddyLazar opened this issue Feb 24, 2016 · 8 comments
Closed

"count" value equals to "limit" #625

eddyLazar opened this issue Feb 24, 2016 · 8 comments
Labels
type:question Support or code-level question

Comments

@eddyLazar
Copy link
Contributor

query request with count=1 for counting objects, id always equal to requested limit param, and doesn't show count of all objects.

@eddyLazar
Copy link
Contributor Author

just noticed that if results are empty for example:
?count=1&limit=10&order=-_updated_at&skip=100

{ "results": [], "count": 120 }

then count value in response is correct;

@gfosco
Copy link
Contributor

gfosco commented Feb 26, 2016

What we say in the rest docs, is to set limit to 0 and get no objects when doing a count query... Is your intention to just get the count, or to also get results?

@eddyLazar
Copy link
Contributor Author

oh, it was actually working properly with Parse.com rest api.
I'm building a CRUD spa Application on top of ParseServer rest api, and it wouldn't be handy to send two requests every time for building pagination for example

@douineauromain
Copy link

Hi,

I have a similar problem with the Javascript SDK :

 var Players = Parse.Object.extend("Players");
        var query = new Parse.Query(Players);
        query.count({
            success: function(count) {
                // The count request succeeded. Show the count
                nbOfPlayer = count;
            },
            error: function(error) {
                // The request failed
            }
        }

Result from Parse.com is right (more than 100)
Result from parse-server is limited to 100

And quert.limit(x) change nothing

I use :

"parse": "^1.6.13",
"parse-server": "^2.1.3"

@mahabubakram
Copy link

@gfosco I still have the problem regarding count. It returns only 100 as value. But in previous rest.api it was working. Can you please give us the update regarding this issue.

@gfosco
Copy link
Contributor

gfosco commented Mar 6, 2016

Submitted #867 to remove the limit when counting objects... Take a look and make the same change if you'd like to test this behavior. Thanks. 👍

@gfosco gfosco closed this as completed Mar 6, 2016
@haroot
Copy link

haroot commented Aug 7, 2018

Having same problem, Cardinality of the set is not being counted properly...

@flovilmart
Copy link
Contributor

@haroot what do you mean?

@mtrezza mtrezza added type:question Support or code-level question and removed 🔧 troubleshooting labels Jul 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:question Support or code-level question
Projects
None yet
Development

No branches or pull requests

7 participants