generates mongoose schemas from json documents, supports DBRefs and Arrays of DBRef