[][src]Function ejdb_sys::ejdbsavebson

pub unsafe extern "C" fn ejdbsavebson(
    coll: *mut EJCOLL,
    bs: *mut bson,
    oid: *mut bson_oid_t
) -> bool

Persist BSON object in the collection. If saved bson does't have _id primary key then oid will be set to generated bson _id, otherwise oid will be set to the current bson's _id field.

NOTE: Field names of passed bs object may not contain $ and . characters, error condition will be fired in this case.

@param coll JSON collection handle. @param bson BSON object id pointer. @param oid OID pointer will be set to object's _id @return If successful return true, otherwise return false.