X DevAPI User Guide for MySQL Shell in JavaScript Mode

4.2.1 Creating a Collection

In order to create a new collection call the createCollection() function from a Schema object. It returns a Collection object that can be used right away to, for example, insert documents into the database.

// Create a new collection called 'my_collection'
var myColl = db.createCollection('my_collection');