getCollectionList

Collection.getCollectionList(dbApiKey)

Returns a list of all collections in a database.

Parameters

The method has the following parameter:

Parameters

Description

Required

dbApiKey

The database API (ID) key for which to return a list of all collections.

Yes.

Example

This example prints to the Server Code console (trace) to all of the custom collections in a database, specified by the database API key.

var dbApiKey = "c33010af-f263-4443-9897-c2ffaf522956";
var collections = Collection.getCollectionList(dbApiKey);
console.log(collections);
[ { name: 'Students' }, { name: 'Course' }, { name: 'Grades' } ]