lib/common/misc.js
function convertAllObjectIdsToString(form) {
  form._id = form._id ? form._id.toString() : form._id;
  form.pages = _.map(form.pages, function(page) {
    page._id = page._id ? page._id.toString() : page._id;

    page.fields = _.map(page.fields, function(field) {
      field._id = field._id ? field._id.toString() : field._id;
      return field;
    });

    return page;
  });
  return form;
}
function convertAllObjectIdsToString(form) {
  form._id = form._id ? form._id.toString() : form._id;
  form.pages = _.map(form.pages, function(page) {
    page._id = page._id ? page._id.toString() : page._id;

    page.fields = _.map(page.fields, function(field) {
      field._id = field._id ? field._id.toString() : field._id;
      return field;
    });

    return page;
  });
  return form;
}
function convertAllObjectIdsToString ( form ) { form . _id = form . _id ? form . _id . toString ( ) : form . _id ; form . pages = _ . map ( form . pages , function ( page ) { page . _id = page . _id ? page . _id . toString ( ) : page . _id ; page . fields = _ . map ( page . fields , function ( field ) { field . _id = field . _id ? field . _id . toString ( ) : field . _id ; return field ; } ) ; return page ; } ) ; return form ; }
Handy Function To convert All ObjectIds to strings.
Handy Function To convert All ObjectIds to strings .