Skip to content

Use your database from code

Every database you build in the app is also a document database you can use from code. Copy a connection string, install the SDK (or send plain HTTPS requests), and use the MongoDB methods you know: find, insertOne, updateMany, aggregate, change streams and more.

The data never moves: it stays in one file in your Google Drive. People keep editing it in the app while your code reads and writes it, and both sides see each other’s changes within seconds.

import { DriveDB } from '@faeizfurqan/drivedb';
const db = new DriveDB(process.env.DRIVEDB_URL!).db();
const clients = db.collection('clients');
await clients.insertOne({ name: 'Ada Lovelace', status: 'Lead', dealValue: 4800 });
const won = await clients.find({ status: 'Won' }).sort({ dealValue: -1 }).toArray();

MongoDB methods

Queries, update operators, aggregation pipelines, upserts, unique fields, relations and change streams, with the same syntax as the MongoDB driver.

Your Drive, your data

The database is a file in your own Google Drive. Nothing is copied to another database; revoke a connection string and it stops working at once.

No-code and code together

Your team edits records in the app; your scripts, websites and automations use the same data through the API.

Any language

The TypeScript SDK runs in Node.js, Bun, Deno, Cloudflare Workers and browsers. Everything else uses plain HTTPS with JSON.

Your code ── HTTPS + connection string ──▶ Data API ──▶ the database file in your Google Drive
▲
The app (in your browser) ── syncs directly ─────────────────┘
  • The Data API keeps a working copy of your database in memory, answers MongoDB-style calls, logs every write safely, and saves to your Drive within about 2 seconds.
  • The app and the API merge their changes record by record and field by field, so an edit in the app and a write from your code never overwrite each other’s work on different fields.

Made by Faeiz Furqan