Checked insertion of studies in MongoDB