Define molecular ion.
When a molecule loses or gains electrons, the resulting species is called a molecular ion.
For example, O2 when loses one electron forms on but when absorbs an electron it forms O2+ ion. These ions are called molecular ions.
Similarly, N2 N2+ etc are examples of molecular ions.
These are short lived species and only exist at high temperature Molecular ions do not for ionic compounds.