@convex-dev/server
Server library for Convex functions to interact with data in the Convex Cloud.
Usage
Convex functions access the database by importing either db
or dbWriter
from
this package. If the function only needs read-only access to the database, use
db
, which implements the
DatabaseReader
interface.
import { db } from "@convex-dev/server";
export async function reader(...args: any[]) {
}
If your function needs to write to the database, such as inserting, updating, or
deleting documents, use dbWriter
, which implements the
DatabaseWriter
interface.
import { dbWriter } from "@convex-dev/server";
export async function writer(...args: any[]) {
}
See
the Convex Getting Started guide
for more details on how to get started.
See also