khonsulabs / bonsaidb

A developer-friendly document database that grows with you, written in Rust
https://bonsaidb.io/
Apache License 2.0
1.03k stars 37 forks source link

Improve `Collection::push` documentation #317

Open a-0-dev opened 7 months ago

a-0-dev commented 7 months ago

As Transaction::insert(...)'s documentation comment states, the function returns a ConflictError if the ID of the document already exists.

Since this function is buried deep down in BonsaiDB's code, I would suggest adding a hint to that behaviour in the docstring of Collection::push(...), since that is the function users will most likely interact with.