createCollection()
Creates a new collection where data will be stored
Example
db.createCollection("users").then(() => {
console.log("createCollection:", "ok");
}).catch((error) => {
console.log("error:", error);
});
createCollection(name)
Parameter
Description
name
String The name for the collection
Last updated
Was this helpful?