Budibase/budibase · error · Error

actionType ${query.extra.actionType} does not exist on DB fo

Error message

actionType ${query.extra.actionType} does not exist on DB for delete

What it means

MongoDB integration's delete() switches on query.extra.actionType to pick deleteOne or deleteMany (with filter and options). If the actionType is not one of these, the default branch throws 'actionType <X> does not exist on DB for delete'.

Source

Thrown at packages/server/src/integrations/mongodb.ts:635

        filter: Filter<any>
        options: OperationOptions
      }
      if (!json.options) {
        json = {
          filter: json,
          options: {},
        }
      }

      switch (query.extra.actionType) {
        case "deleteOne": {
          return await collection.deleteOne(json.filter, json.options)
        }
        case "deleteMany": {
          return await collection.deleteMany(json.filter, json.options)
        }
        default: {
          throw new Error(
            `actionType ${query.extra.actionType} does not exist on DB for delete`
          )
        }
      }
    } catch (err) {
      console.error("Error writing to mongodb", err)
      throw err
    } finally {
      await this.client.close()
    }
  }

  async aggregate(query: {
    json: object
    steps: any[]
    extra: { [key: string]: string }
  }): Promise<Document[]> {
    try {

View on GitHub (pinned to a81a902e9a)

Solutions

  1. Set query.extra.actionType to exactly "deleteOne" or "deleteMany"
  2. Ensure json.filter targets the documents to remove and json.options is a valid DeleteOptions object
  3. Re-create or re-save the query in the builder so it emits a valid actionType
  4. Validate actionType against the supported delete actions before dispatch

Example fix

// before
const query = { table: "users", json: { filter: { stale: true } }, extra: { actionType: "remove" } }
// after
const query = { table: "users", json: { filter: { stale: true } }, extra: { actionType: "deleteMany" } }
Defensive patterns

Strategy: validation

Validate before calling

const DELETE_ACTIONS = ["deleteOne", "deleteMany"]
if (!DELETE_ACTIONS.includes(query.extra?.actionType)) {
  throw new Error(`Invalid delete actionType: ${query.extra?.actionType}`)
}
await ds.delete(query)

Type guard

function isDeleteAction(t: unknown): t is "deleteOne" | "deleteMany" {
  return t === "deleteOne" || t === "deleteMany"
}

Try / catch

try {
  await ds.delete(query)
} catch (err) {
  if (err.message.includes("does not exist on DB for delete")) {
    throw new Error(`Unsupported MongoDB delete action "${query.extra?.actionType}"; use deleteOne or deleteMany`, { cause: err })
  }
  throw err
}

Prevention

When it happens

Trigger: Executing a delete query whose actionType is misspelled, empty, or belongs to another family (e.g. 'remove', 'delete' instead of 'deleteOne'/'deleteMany').

Common situations: Payloads copied from Mongoose or shell syntax ('remove') into Budibase queries; hand-edited query JSON; queries created before an action rename or migration.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of Budibase/budibase@a81a902e9a (2026-08-29). Data as JSON: /api/errors/1066ea64345cd4f0. Report an issue: GitHub.