Skip to content

Commit

Permalink
Update grovedb/src/operations/insert/mod.rs
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
QuantumExplorer and coderabbitai[bot] authored Sep 27, 2024
1 parent fa3a9eb commit ed6a0a0
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion grovedb/src/operations/insert/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,21 @@ impl GroveDb {
}

/// Insert if not exists
/// The bool return is whether we were able to insert
/// Insert if not exists
///
/// Inserts an element at the specified path and key if it does not already exist.
///
/// # Arguments
///
/// * `path` - The path where the element should be inserted.
/// * `key` - The key under which the element should be inserted.
/// * `element` - The element to insert.
/// * `transaction` - The transaction argument, if any.
/// * `grove_version` - The GroveDB version.
///
/// # Returns
///
/// Returns a `CostResult<bool, Error>` indicating whether the element was inserted (`true`) or already existed (`false`).
pub fn insert_if_not_exists<'b, B, P>(
&self,
path: P,
Expand Down

0 comments on commit ed6a0a0

Please sign in to comment.