eveningkid / denodb

MySQL, SQLite, MariaDB, PostgreSQL and MongoDB ORM for Deno

Home Page:https://eveningkid.com/denodb-docs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

insert or update

sadorowo opened this issue · comments

Is this even possible? I want to update document if it exists, otherwise create a new document.

Example:

await Model
   .insertOrUpdate(
      { primaryKey: "sth" },
      { first: 1, next: 2 }
   )

// this should update document or insert new: { primaryKey: "sth", first: 1, next: 2 }