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 update

What it means

MongoDB integration's update() switches on query.extra.actionType to pick updateOne or updateMany (with filter, update, options). If the actionType is not a supported update operation, the default branch throws 'actionType <X> does not exist on DB for update'.

Source

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

      }

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

  async delete(query: MongoDBQuery): Promise<DeleteResult> {
    try {
      await this.connect()
      const db = this.client.db(this.config.db)
      const collection = db.collection(query.extra.collection)
      let queryJson = query.json

View on GitHub (pinned to a81a902e9a)

Solutions

  1. Set query.extra.actionType to exactly "updateOne" or "updateMany"
  2. Ensure the JSON payload includes filter and update fields compatible with the chosen action
  3. Re-create or re-save the query in the builder so the generated payload matches the operation
  4. Validate actionType against the supported list before execution

Example fix

// before
const query = { table: "users", json: { filter: { _id: 1 }, update: { $set: { name: "x" } } }, extra: { actionType: "update" } }
// after
const query = { table: "users", json: { filter: { _id: 1 }, update: { $set: { name: "x" } } }, extra: { actionType: "updateOne" } }
Defensive patterns

Strategy: validation

Validate before calling

const UPDATE_ACTIONS = ["updateOne", "updateMany"]
if (!UPDATE_ACTIONS.includes(query.extra?.actionType)) {
  throw new Error(`Invalid update actionType: ${query.extra?.actionType}`)
}
await ds.update(query)

Type guard

function isUpdateAction(t: unknown): t is "updateOne" | "updateMany" {
  return t === "updateOne" || t === "updateMany"
}

Try / catch

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

Prevention

When it happens

Trigger: Executing an update query whose actionType is misspelled, empty, or not an update-family action (e.g. 'update' instead of 'updateOne', or 'replaceOne' when unsupported by the mapping).

Common situations: Hand-built JSON payloads missing the exact action names; queries copied from MongoDB shell syntax into Budibase queries; schema drift after editing a query's operation type in the UI.

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/2e21f9ef3c1c61cc. Report an issue: GitHub.