MongoDB. . Sort. . 3) Remove Column If Exists using Migration. Search Mongodb Check If Field Exists In Array. Here is the query to check whether the field exist in MongoDB. Check the parentNode Property. count () > 0. A bit better fix is you should set a unique index on the username and on the email fields. . MongoDB supports two types of schema validation.