Is there any way to get all COLLECTION names in BAAS using javascript sdk...?
Answer by Anil Sagar @ Google
·
Sep 24, 2016 at 05:33 PM
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.
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.
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