![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
cloudant-upsert
Advanced tools
![](https://img.shields.io/badge/status-stable-green.svg) ![](https://img.shields.io/badge/license-MIT-blue.svg)
A no-dependency module that adds an upsert
function to the nodejs-cloudant module.
npm install cloudant-upsert
The following adds the upsert
function to a cloudant
instance
var Cloudant = require('@cloudant/cloudant');
var cloudant = Cloudant('<YOUR_CLOUDANT_URI>');
require('cloudant-upsert')(cloudant);
In the example below prevdoc
contains null
or the previous doc
cloudant.db.use('mydb').upsert('carmine', prevdoc => ({
"text": "Woop Woop! We're using promises",
}))
.then(r => console.log('result', r))
.catch(e => console.log('error', e.message));
In the example below prevdoc
contains null
or the previous doc
cloudant.db.use('mydb').upsert('carmine', prevdoc => ({
"text": "Woop! Woop! We're using callbacks"
}), (err, data) => {
if (err) console.log('error', err.reason)
else console.log('data', data)
})
upsert(id, function(prevdoc)
)param | description |
---|---|
id | The document id to upsert |
function(prevdoc): doc | A function that provides the previous document (or null when inserting a new doc) as input. You must return the document to upsert. |
upsert(id, function(prevdoc), function(err, res)}
param | description |
---|---|
id | The document id to upsert |
function(prevdoc): doc | A function that provides the previous document (or null when inserting a new doc) and returns a new document to upsert |
function(err, res): void | A Node.js error first callback |
FAQs
![](https://img.shields.io/badge/status-stable-green.svg) ![](https://img.shields.io/badge/license-MIT-blue.svg)
The npm package cloudant-upsert receives a total of 148 weekly downloads. As such, cloudant-upsert popularity was classified as not popular.
We found that cloudant-upsert demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.