# db.collection
Gets a reference to data collection.
The method signature is shown as below:
function collection(name: string): Collection
The method accepts a name parameter to specify the name of the collection to be referenced.
Sample code
const db = wx.cloud.database()
const todosCollection = db.collection('todos')