Skip to main content

obj_find_unique

Function obj_find_unique 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn obj_find_unique( txn: *mut obj_read_txn_t, collection: *const c_char, index_name: *const c_char, key: *const u8, key_len: usize, out_id: *mut u64, out_payload: *mut *mut u8, out_payload_len: *mut usize, ) -> obj_error_t
Expand description

Look up a single doc by index key on a Unique index. The caller pre-encodes key_bytes per M7’s order-preserving scheme. Returns OBJ_ERR_NOT_FOUND when no doc matches.

§Safety

  • txn must be live.
  • collection, index_name, key follow the usual pointer rules; key may be NULL when key_len == 0.
  • out_id, out_payload, out_payload_len must be writable.