Check out example codes for "sort even dont exists meta wordpress". It will help you in understanding the concepts better.

Code Example 1

$query->set( 'meta_query', array(
    'relation' => 'OR',
    array(
        'key' => 'custom_meta_key', 
        'compare' => 'EXISTS'
    ),
    array(
        'key' => 'custom_meta_key', 
        'compare' => 'NOT EXISTS'
    )
) );
$query->set( 'orderby', 'meta_value title' );

Learn ReactJs, React Native from akashmittal.com