Create a new document

First, reference the collection you'd like to insert a document into.

const projects = adamite().database().collection("projects");

Now, you can call create on the collection reference to insert a new document. The document (including it's automatically generated id) will be returned to you.

const newProject = await projects.create({
  name: "Test"
});

Last updated