Skip to main content
Deno 2 is finally here 🎉️
Learn more
Extremely Popular
Go to Latest
method Database.prototype.createCollection
import { Database } from "https://deno.land/x/mongo@v0.31.1/src/database.ts";

createCollection executes a create command to create a new collection with the specified name and options.

https://www.mongodb.com/docs/manual/reference/command/create/#mongodb-dbcommand-dbcmd.create

Parameters

name: string
optional
options: CreateCollectionOptions

Returns

Promise<Collection<T>>