Skip to content

merge(["some", "fields"]) is not available #2024

@vvo

Description

@vvo

Hi there, I was trying to use:

Model.query()
  .insert({name: "Hello", age: 10, uniqueId: 2})
  .onConflict("uniqueId")
  .merge(["name"]);

As per Knex documentation: http://knexjs.org/#Builder-merge.
image

But it seems like only the object mode works with Objection.js:

Model.query()
  .insert({name: "Hello", age: 10, uniqueId: 2})
  .onConflict("uniqueId")
  .merge({name: "Hello"});

Which is fine, I can use this instead. But maybe we want to have the same API than Knex here too?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions