{ Community }
  • Academy
  • Docs
  • Developers
  • Resources
    • Community Articles
    • Apigee on GitHub
    • Code Samples
    • Videos & eBooks
    • Accelerator Methodology
  • Support
  • Ask a Question
  • Spaces
    • Product Announcements
    • General
    • Edge/API Management
    • Developer Portal (Drupal-based)
    • Developer Portal (Integrated)
    • API Design
    • APIM on Istio
    • Extensions
    • Business of APIs
    • Academy/Certification
    • Analytics
    • Events
    • Hybrid
    • Integration (AWS, PCF, Etc.)
    • Microgateway
    • Monetization
    • Private Cloud Deployment
    • Insights
    • IoT Apigee Link
    • BaaS/Usergrid
    • BaaS Transition/Migration
    • Apigee-127
    • New Customers
    • Topics
    • Questions
    • Articles
    • Ideas
    • Leaderboard
    • Badges
  • Log in
  • Sign up

Get answers, ideas, and support from the Apigee Community

  • Home /
  • BaaS/Usergrid /
avatar image
1
Question by shopby · Jun 28, 2016 at 08:37 PM · 482 Views baasquery

Problem with a query limit, it’s only returning 10 items.

First off I have 15 items in a collection.

1- this query only returns 10 items: qs:{ql:"name = '*'"}

2- this query only returns 10 items: qs:{ql:"name = '*' limit=20"}

3- this query qs:{ql:"name = '*' & limit=20"} return this error: “Error (400)(query_token): MismatchedTokenException(32!=38)”

4- this query returns 0 items: qs:{ql:"name = '*' and limit=20"}

Looking for some help with syntax.

This is a free account, is it possible Apigee is limiting all queries to 10 ???

I know the default is 10 but you can get more by setting the limit to a higher number.

I followed the info for Node.js at the link:

http://docs.apigee.com/app-services/content/querying-your-data

SAMPLE CODE:

//==========================================

RemoteController.getAllLevelWords = function() {
var allLevelObj = {
endpoint:"levelwords",    
qs:{ql:"name = '*' & limit=20"}};

client.request(allLevelObj, function (error, response) {  
if (error){
  console.log("getAllLevelWords error = "+ error);  }
else {    
  console.log("getAllLevelWords response = "+response);}     
});         
};
Comment
Add comment Show 3
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image clatimer1 ♦ · Jun 28, 2016 at 10:40 PM 0
Link

limit should be it's own query parameter. It looks like your code may URL encode that & symbol rather than treating it as a second query param. Can you try making a call directly from your browser or an API client with limit as a separate URL query parameter and see if the behavior changes?

avatar image shopby · Jun 28, 2016 at 11:20 PM 0
Link

clatimer1 : I tried 2 additional ways and neither one works. Any more suggestions?

Remember I started following the instructions from Apigee web site, so putting the limit inside the one query is what is recommended.

This one returned zero records:

 var allLevelObj = {
endpoint:"levelwords",
qs:{ql:"name = '*'"},
qs:{ql:"limit=20"}
};

This one returned 10 records: (added a comma)

 var allLevelObj = {
endpoint:"levelwords",
qs:{ql:"name = '*', limit=20"}
};
avatar image Dino ♦♦ shopby   · Jun 28, 2016 at 11:22 PM 0
Link

try this:

 var allLevelObj = {
    endpoint:"levelwords",
    qs:{ql:'name = *', limit:20}
  };

Close

1 Answer

  • Sort: 
avatar image
3
Best Answer

Answer by Dino   · Jun 28, 2016 at 11:20 PM

I think there's a typo (Sorry!) in that documentation page.

I believe the correct syntax is:

RemoteController.getAllLevelWords = function() {
  var allLevelObj = {
        endpoint:"levelwords",    
        qs:{
          ql:"name = *",
          limit: 20} // note - limit is a separate property
      };


  client.request(allLevelObj, function (error, response) {  
    if (error){
      console.log("getAllLevelWords error = "+ error);  }
    else {    
      console.log("getAllLevelWords response = "+response);}     
  });         
};

Comment
Add comment Show 1 · Link
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image shopby · Jun 28, 2016 at 11:39 PM 0
Link

Finally got it to work with: thanks Dino

 var allLevelObj = {
     endpoint:"levelwords",
     qs:{ql:"name = '*'", limit:20}
  };

Follow this Question

Answers Answers and Comments

33 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

BAAS: SELECT * WHERE [element] CONTAINS '[value-with-hyphens]' 1 Answer

Query for fetching latest/last 10 records 1 Answer

Is it possible to query a collection on items in an entity array? 2 Answers

How can i filter users via uuid? 1 Answer

Select fields in BaaS query 1 Answer

  • Products
    • Edge - APIs
    • Insights - Big Data
    • Plans
  • Developers
    • Overview
    • Documentation
  • Resources
    • Overview
    • Blog
    • Apigee Institute
    • Academy
    • Documentation
  • Company
    • Overview
    • Press
    • Customers
    • Partners
    • Team
    • Events
    • Careers
    • Contact Us
  • Support
    • Support Overview
    • Documentation
    • Status
    • Edge Support Portal
    • Privacy Policy
    • Terms & Conditions
© 2019 Apigee Corp. All rights reserved. - Apigee Community Terms of Use - Powered by AnswerHub
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Post an idea
  • Spaces
  • Product Announcements
  • General
  • Edge/API Management
  • Developer Portal (Drupal-based)
  • Developer Portal (Integrated)
  • API Design
  • APIM on Istio
  • Extensions
  • Business of APIs
  • Academy/Certification
  • Analytics
  • Events
  • Hybrid
  • Integration (AWS, PCF, Etc.)
  • Microgateway
  • Monetization
  • Private Cloud Deployment
  • Insights
  • IoT Apigee Link
  • BaaS/Usergrid
  • BaaS Transition/Migration
  • Apigee-127
  • New Customers
  • Explore
  • Topics
  • Questions
  • Articles
  • Ideas
  • Members
  • Badges