Delete a document and return it
const url = 'https://your-app-domain/v1/db/example/findOneAndDelete';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"collection":"example","filter":{"additionalProperty":"example"},"sort":{"additionalProperty":1},"projection":{"additionalProperty":"example"},"writeConcern":{"w":"log"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://your-app-domain/v1/db/example/findOneAndDelete \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "collection": "example", "filter": { "additionalProperty": "example" }, "sort": { "additionalProperty": 1 }, "projection": { "additionalProperty": "example" }, "writeConcern": { "w": "log" } }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The database id (the last part of the connection string).
Request Bodyrequired
Section titled “Request Bodyrequired”object
Collection (table) API name
MongoDB query filter
object
Fields to include or exclude
object
{ w: “drive” } waits until the change is saved to Google Drive
object
Responses
Section titled “Responses”Success
object
Example generated
{ "document": { "_id": "example", "_createdAt": "2026-04-15T12:00:00Z", "_updatedAt": "2026-04-15T12:00:00Z" }}Invalid request (BadRequest, ValidationError, BadValue, ImmutableField, InvalidName).
object
object
object
Example generated
{ "error": { "code": "example", "message": "example", "details": {} }}Missing, wrong, revoked or expired connection string, or Google access was removed (Unauthorized).
object
object
object
Example generated
{ "error": { "code": "example", "message": "example", "details": {} }}Read-only connection string (ReadOnlyKey) or a database you can only view (ReadOnly).
object
object
object
Example generated
{ "error": { "code": "example", "message": "example", "details": {} }}Unknown collection (NamespaceNotFound) or action (UnknownAction).
object
object
object
Example generated
{ "error": { "code": "example", "message": "example", "details": {} }}A unique field already has this value (DuplicateKey).
object
object
object
Example generated
{ "error": { "code": "example", "message": "example", "details": {} }}Request body over 1 MB (PayloadTooLarge).
object
object
object
Example generated
{ "error": { "code": "example", "message": "example", "details": {} }}Too many requests (RateLimited). Wait for Retry-After seconds.
object
object
object
Example generated
{ "error": { "code": "example", "message": "example", "details": {} }}The database file is unavailable (DatabaseUnavailable) or Google Drive is busy (DriveUnavailable, retry).
object
object
object
Example generated
{ "error": { "code": "example", "message": "example", "details": {} }}The owner’s Google Drive is full (DriveFull).
object
object
object
Example generated
{ "error": { "code": "example", "message": "example", "details": {} }}Made by Faeiz Furqan