{ 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 Dipen Vaghela · Sep 24, 2016 at 05:35 AM · 152 Views collectionsjavascript SDK

Apigee BaaS Javascript SDK, How to retrieve all collection names ?

Is there any way to get all COLLECTION names in BAAS using javascript sdk...?

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
Best Answer

Answer by Anil Sagar @ Google   · Sep 24, 2016 at 05:33 PM

@Dipen Vaghela ,

Yes, You can retrieve same using Javascript SDK, see example below,

    <script>
    var client_creds = {
        orgName:'ORGNAME',
        appName:'APPNAME'
    }


    //Initializes the SDK. Also instantiates Apigee.MonitoringClient
    var dataClient = new Apigee.Client(client_creds);
    var options = {
       client:dataClient, //our Apigee.Client object
       type: ''
    }
    collection = new Apigee.Collection(options); //this creates our local object


    /* Next we call fetch(), which initiates our GET request to the API: */
    collection.fetch(function (error, response) {
      if (error) {
        // Error - there was a problem retrieving the collection


      } else {
        // Success - the collection was found and retrieved by the Apigee API
        console.log(response.entities[0].metadata.collections);
      }
    });
    </script>

Also, Using the below BaaS API you can retrieve all collection names in an App,

https://api.usergrid.com/{BAASORGNAME}/{APPNAME}

Hope it helps.

Comment
Add comment Show 3 · 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 Dipen Vaghela · Sep 26, 2016 at 04:50 AM 0
Link

Thanks for your support.

avatar image Dipen Vaghela · Sep 26, 2016 at 04:57 AM 0
Link

It works. thanks again.

avatar image Anil Sagar @ Google ♦♦ Dipen Vaghela   · Sep 26, 2016 at 05:47 AM 0
Link

Anytime :) Glad issue is resolved, You can also click on Accept link below the answer so that it will be helpful for others. Keep us posted if any in future.

Follow this Question

Answers Answers and Comments

27 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

Related Questions

i am not able to delete collection through shell 2 Answers

How to throw an error while creating a duplicate collection in the BAAS 1 Answer

Is there a way to query a collection for entities that do not contain an attribute? 2 Answers

Apigee Baas - No collections found 3 Answers

Remove meta-data while retrieving collection from 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