Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can i use all_or_nothing option when doing bulk insertion #263

Open
Ting-y opened this issue Nov 13, 2014 · 3 comments
Open

How can i use all_or_nothing option when doing bulk insertion #263

Ting-y opened this issue Nov 13, 2014 · 3 comments

Comments

@Ting-y
Copy link

Ting-y commented Nov 13, 2014

Is there any way to add the all_or_nothing options when using db.save([docs], callback)?

In the example blow is the POST -d {all_or_nothing:true, docs:[]}
Example :http://wiki.apache.org/couchdb/Replication_and_conflicts

@fwoelffel
Copy link

You can activate this feature when instantiating the Connection object:

const c = new cradle.Connection({
  host: this._host,
  port: this._port,
  allOrNothing: true,
  cache: false
});

The documentation is missing this point but it's working. (However it won't work with CouchDB 2 atm)

@jofomah
Copy link

jofomah commented Dec 5, 2016

@fwoelffel i am currently having issues with CouchDB 2.0, please do you why all_or_nothing won't work on CouchDB 2.0 and any alternative or work around to achieve ACID for bulk update?? Thanks for your anticipated help.

@fwoelffel
Copy link

fwoelffel commented Dec 5, 2016

Last time I checked the source code it was simply not implemented yet. I can't say if it is now (it appears not) and I can't remember where I saw that. I also need this but for the moment I simply push bulk in a non-atomic way...

If anyone could provide some complementary information that would be greatly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants