pouchdb / upsert

PouchDB plugin for upsert() and putIfNotExists() functions
Apache License 2.0
149 stars 25 forks source link

Upsert error #25

Closed arjunnaha closed 7 years ago

arjunnaha commented 7 years ago

Whenever I try to upsert by returning a new object I always get a 500 error. Whether this is an issue with the data I'm trying to add or something else...

Upsert error: {"status":500,"name":"doc_validation","message":"Bad special document member: _body","reason":"_body"}

this.db.upsert('profile', function (doc) {
  return data;
}).then(function (res) {
console.log("Upsert success")
}).catch(function (err) {
  console.log("Upsert error: " + err)
});
nolanlawson commented 7 years ago

Usually this is a CORS error due to CORS not being enabled on the remote server. Do you see any errors in the Console or Network tab?

arjunnaha commented 7 years ago

There aren't any CORS errors in the Console or Network tab. I don't think it is a CORS issue, because I've logged the data before upserting it and I can see the data in the log.

nolanlawson commented 7 years ago

Please reopen if you manage to track down the issue