{ 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
    • Adapter for Envoy
    • 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
0
Question by MarlenePecotich · Nov 21, 2018 at 12:40 AM · 118 Views baas queries

Is there a way to query a BAAS collection based on entity count?

Hi,

I have a requirement where I need to search for users in a BAAS collection where they have more than 300 entities. However, I have noticed that the query language doesn't support count.

"API BaaS is not an RDBMS. It does not include RDBMS features such as count(*) and cross-table joins."

See https://docs.apigee.com/api-baas/data-storage/evaluating-api-baas-data-store

Has anyone found a way around this?

Comment
Add comment
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

Close

1 Answer

  • Sort: 
avatar image
0

Answer by Imesh Gunaratne · Nov 23, 2018 at 03:11 AM

The number of entities in a collection in Apigee BaaS can be found by using the following management API resource:

1. Make an API request to the following resource:
curl -n https://{baas-hostname}/{orgName}/{appName}/

2. Read the count property of the required collection:
A sample response may look like below:

{
    "action": "get",
    "application": "xxx",
    "params": {},
    "uri": "https://baas-hostname/org/app",
    "entities": [
        {
            "uuid": "xxx",
            "type": "application",
            "name": "org/app",
            "accesstokenttl": null,
            "applicationName": "app",
            "organizationName": "org",
            "created": 1515202544207,
            "modified": 1515202544207,
            "metadata": {
                "collections": {
                    "items": {
                        "count": 8,
                        "name": "items",
                        "type": "item",
                        "title": "items"
                    }
                }
            }
        }
    ],
    "timestamp": 1542780918747,
    "duration": 36,
    "organization": "org",
    "applicationName": "app"
}
	

Please note that the count value would not be accurate if the number of entities in the collection is considerably large.

More importantly, please note that Apigee has deprecated BaaS with the intension of reusing Google Cloud products such as Cloud Firestore, Cloud Datastore, Cloud Spanner, Cloud SQL, etc instead. Please find more information on this at [1].

[1] https://apigee.com/about/blog/api-technology/were-sunsetting-apigee-api-baas

Thanks!

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 MarlenePecotich · Nov 23, 2018 at 03:17 AM 0
Link

Thanks... I am aware that the count is returned but I wanted to return entities from there query where the a certain user had more than 300. So it's a condition in the query.

All good. We are aware of the deprecation.

Follow this Question

Answers Answers and Comments

46 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 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

How to create a read only admin user in Baas Portal? 1 Answer

What is maximum payload size for a message that can be saved in Apigee BAAS 1 Answer

Unable to generate access token from BaaS 1 Answer

How do I correctly use decimal values in BaaS? 2 Answers

Tips for speeding up BaaS 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
© 2021 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
  • Adapter for Envoy
  • 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
  • Badges