Skip to main content

obj_doc_insert

Function obj_doc_insert 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn obj_doc_insert( txn: *mut obj_write_txn_t, collection: *const c_char, payload: *const u8, payload_len: usize, out_id: *mut u64, ) -> obj_error_t
Expand description

Insert a raw-bytes document into collection. The collection is lazy-created if absent. On success *out_id is set to the freshly-allocated id.

ยงSafety

  • txn must be a live write txn handle.
  • collection must be a non-null NUL-terminated UTF-8 string.
  • payload may be null IFF payload_len == 0; otherwise it must point to payload_len readable bytes.
  • out_id must be a writable uint64_t *.