damienp33 / express-mongoose-generator Goto Github PK
View Code? Open in Web Editor NEWMongoose generator for Express.js 4
License: MIT License
Mongoose generator for Express.js 4
License: MIT License
Awesome tool, but currently the tool generates DOS line endings on Mac OS X, not unix line endings. Not sure if it works correctly on Linux.
I would like the code generated in .ts instead of .js.
How can I do that?
Hi,
I liked the project idea very much. Thanks for sharing.
Currently Array attribute do not specify the type of objects in array. We should be able to configure it.
For instance,
emailAddresses: [String],
Messages: [{type: Schema.Types.ObjectId, ref:'Message'}]
Hi, thank you very much for this nice stuff.
Can u plz tell me where can i put this (beginner :-) ) ? Can you integrate this in the generator?
great job !!! I love it and plan to recommend it during my next meet-up in Bali.
could we have the option to generate only one folder named after the model then get all generated files in this folder?
Hi @DamienP33 , thank you very much for this generator, it's been very helpfull.
I miss the ObjectID type, and hacked a bit into your code to provide this functions
I got it working for some time now, but today I share with you
Hope you like and it can be usefull or at least consider using this
I have no tests written thou, sorry
Here's the PR
#1
I suppose you have a typing error. You used "ALLOWER_FIELDS_TYPES" to replace "allowedFieldsTypes" in bin/mongoose-gen.
I think you should have used "ALLOWED_FIELDS_TYPES" instead of "ALLOWER_FIELDS_TYPES".
Let me know if I'm wrong.
Good job. Thank you very much,Hug from Colombia
It's something small really. I'm raising as an issue for myself to come back PR as soon as I have a moment.
๐พ
possibility to add nested sub document within the model?
thanks in advance
thx for the excellent generator
is there any way to override the templates?
mongoose-gen
Model Name : car
Available types : string, number, date, boolean, array, objectId
Field Name (press <return> to stop adding fields) : door
Field Type [string] : number
Field Name (press <return> to stop adding fields) : color
Field Type [string] :
Field Name (press <return> to stop adding fields) : owner
Field Type [string] : objectid
Invalid Argument : Field type is not allowed
Field Type [string] : objectId
Reference (model name referred by the objectId field) : User
Field Name (press <return> to stop adding fields) :
Generate Rest (yes/no) ? [yes] : yes
Files tree generation grouped by Type or by Module (t/m) ? [t] : m
create: ./car
create: ./car/carRoutes.js
create: ./car/carModel.js
create: ./car/carController.js
ken@Ken:~/working/nodejs/tut2$ cat car/carModel.js
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
}); carS}owner' ref: 'User'a.Types.ObjectId,
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.