conditional for handling mongoose objects with _id's