We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
I am a long time couchdb-python user and am currently merging to couchdb2.
couchdb-python
couchdb2
I was wondering if it is possible to return the doc id & rev when put-ing a single document (it is my understanding Database.put returns None).
put
Database.put
None
The workaround would be doing something of the form
# ... success, identifier, revision = db.update([doc])
While working, this workaround seems less satisfying than something like ... = db.put(doc).
... = db.put(doc)
Is there something I am missing or am being overly pedantic here? If not, do you think this feature would be worth considering?
Best regards,
The text was updated successfully, but these errors were encountered:
Both the _id and _rev are updated in the doc when doing db.put(doc). So I do not think it is necessary to return those values also.
_id
_rev
doc
db.put(doc)
You could create a subclass of Database and redefine put to do that, something like this:
class Database2(Database): def put(self, doc): super().put(doc) return doc["_id"], doc["_rev"]
Sorry, something went wrong.
No branches or pull requests
Hi,
I am a long time
couchdb-python
user and am currently merging tocouchdb2
.I was wondering if it is possible to return the doc id & rev when
put
-ing a single document (it is my understandingDatabase.put
returnsNone
).The workaround would be doing something of the form
While working, this workaround seems less satisfying than something like
... = db.put(doc)
.Is there something I am missing or am being overly pedantic here? If not, do you think this feature would be worth considering?
Best regards,
The text was updated successfully, but these errors were encountered: