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

delete problem #25

Open
SergioReis97 opened this issue Mar 28, 2017 · 0 comments
Open

delete problem #25

SergioReis97 opened this issue Mar 28, 2017 · 0 comments

Comments

@SergioReis97
Copy link

Hi, i'm new to sails/couchdb so it might be just a really noob mistake, but I partially can't get this package to work with the default sails blueprint.

I've successfully inserted and read from the database and everything works as it should.
Now, when I try to delete i always get the following errors

": You tried to DELETE a database with a ?rev= parameter. Did you mean to DELETE a document instead?
at Request._callback (.../node_modules/nano/nano.js:319:39)
at Request.self.callback (.../node_modules/request/request.js:122:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request. (.../node_modules/nano/node_modules/request/request.js:888:14)
at emitOne (events.js:101:20)
at Request.emit (events.js:188:7)
at IncomingMessage. (.../node_modules/nano/node_modules/request/request.js:839:12)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickDomainCallback (internal/process/next_tick.js:128:9)"

Delete code i'm using :
io.socket.delete("/user", user, function (data, jwres){ console.log(data); console.log(jwres); });
Playing with postman, i managed to delete using the link
http://localhost:5984/user/one_id_from_db&rev=one_revision_id_from_db
and it worked,
to reproduce the error I've eventually did a
http://localhost:5984/user?id=same_id&rev=same_revision
and sure enough
{"error":"bad_request","reason":"You tried to DELETE a database with a ?rev= parameter. Did you mean to DELETE a document instead?"}

Is it possible that the blueprints are sending id as a normal parameter and not just as /id?rev=...

Thank you for your time

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

1 participant