{"id":14975676,"url":"https://github.com/gothack/forms-mongoose","last_synced_at":"2025-10-27T14:31:05.799Z","repository":{"id":57148712,"uuid":"3640917","full_name":"GothAck/forms-mongoose","owner":"GothAck","description":"Automatic Forms generation from Mongoose Models","archived":false,"fork":false,"pushed_at":"2015-09-22T14:21:18.000Z","size":111,"stargazers_count":54,"open_issues_count":9,"forks_count":15,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-01T06:23:15.318Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GothAck.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-03-06T18:07:58.000Z","updated_at":"2023-08-22T17:04:46.000Z","dependencies_parsed_at":"2022-08-31T23:50:36.760Z","dependency_job_id":null,"html_url":"https://github.com/GothAck/forms-mongoose","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GothAck%2Fforms-mongoose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GothAck%2Fforms-mongoose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GothAck%2Fforms-mongoose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GothAck%2Fforms-mongoose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GothAck","download_url":"https://codeload.github.com/GothAck/forms-mongoose/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238508754,"owners_count":19484198,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-24T13:52:22.678Z","updated_at":"2025-10-27T14:31:05.495Z","avatar_url":"https://github.com/GothAck.png","language":"JavaScript","readme":"### Forms-mongoose allows auto-generation of forms from your Mongoose models\n\nhttp://search.npmjs.org/#/forms-mongoose\n\n### Example\n\n#### Mongoose\n\n```javascript\nvar mongoose = require('mongoose');\nvar Schema = mongoose.Schema;\nvar Email = mongoose.SchemaTypes.Email;\nvar forms = require('forms-mongoose');\n\nvar AddressSchema = new Schema({\n  category: {type: String, required: true, default: 'home', forms: {all:{}}},\n  lines: {type: String, required: true, forms:{all:{widget:forms.widgets.textarea({rows:3})}}},\n  city: {type: String, required: true}  \n});\n\nvar PersonSchema = new Schema({\n  email: { type: Email, unique: true, forms: {\n    all: {\n      type: 'email'\n    }\n  }},\n  confirmed: { type: Boolean, required: true, default: false },\n  name: {\n    first: { type: String, required: true, forms: {\n      new: {},\n      edit: {}\n    }},\n    last: { type: String, required: true, forms: {\n      new: {},\n      edit: {}\n    }}\n  },\n  address: [AddressSchema]\n});\n\nvar PersonModel = mongoose.model('Person', PersonSchema);\n```\n\n#### Convert Mongoose Model to Forms Object\n\n```javascript\nvar forms = require('forms-mongoose');\n\nvar form = forms.create(PersonModel, 'new'); // Creates a new form for a \"new\" Person\n\n// Use the form object as you would with Forms\n\nconsole.log (form.toHTML());\n// Note toHTML does not include the \u003cform\u003e tags, this is to allow flexibility.\n\n//optionally create some static methods in the schema\n\nPersonSchema.statics.createForm = function (extra) {\n  return forms.create(this, extra);\n}\n\nPersonSchema.statics.createAddressForm = function (extra) {\n  return forms.create(this.schema.paths.address, extra);\n}\n```\n\n### Requirements\n\n- [Node.js](http://nodejs.org/)\n\n### Installation\n\n```\nnpm install forms-mongoose\n```\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgothack%2Fforms-mongoose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgothack%2Fforms-mongoose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgothack%2Fforms-mongoose/lists"}