ID as primary field

If you wish to update existing records created before you added the _afterInsert hook. do something like:

export async function Empleoscompartidos_afterQuery(item, context) {
if(!item.empleoID){
 item.empleoID = item._id;
await wixData.update('Empleoscompartidos', item, {suppressAuth:true, suppressHooks:true});
}
    return item;
}