khonsulabs / bonsaidb

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

Improve `Collection::push` documentation #317

Open a-0-dev opened 3 months ago

a-0-dev commented 3 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.