Sails-ArangoJs

Sails-ArangoJs

  • Docs
  • API

›CRUD API

Getting Started

  • Installation
  • Creating Models
  • Testing

CRUD API

  • let
  • create
  • createEach
  • update
  • updateOne
  • upsert
  • find
  • findOne
  • sum
  • avg
  • destroy
  • count
  • aggregate
  • sample
  • findNear
  • findWithCount

Graph & Transactions

  • Implementing transacations
  • Graph

Going Native

  • Native Methods
  • Foxx Services

Upserting Documents

upsert Method

The method used to update a document in a collection. If the record does not exist, its created.

Usage

const updated = await User.upsert({
  id: '3787778',
})
  .set({ full_name: 'Angela W. K.', password: 'zzzzz' })
  .fetch();

// Do something with created records.

if fecth() is added, an array of upserted documents is returned.

Please refer to the update methods for the operators that can be implemented.

← updateOnefind →
  • upsert Method
    • Usage
Sails-ArangoJs
Docs
Getting StartedAPI Reference
Community
User ShowcaseStack OverflowTwitter
More
BlogGitHub
Cloudhub Developer Community
Copyright © 2022 Cloud Hub Limited