Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Mongoose Schema with options #22

Closed
JbIPS opened this issue Nov 19, 2014 · 4 comments
Closed

Build Mongoose Schema with options #22

JbIPS opened this issue Nov 19, 2014 · 4 comments

Comments

@JbIPS
Copy link

JbIPS commented Nov 19, 2014

It would be nice if the Manager could take SchemaOptions so even when the schema is auto-generated by the macro, it takes those options.

Maybe by giving it to the build()method?

@clemos
Copy link
Owner

clemos commented Nov 19, 2014

@clemos clemos closed this as completed Nov 19, 2014
@JbIPS
Copy link
Author

JbIPS commented Nov 19, 2014

Wow, you're fast!

Thanks a lot

@clemos
Copy link
Owner

clemos commented Nov 19, 2014

⚡ , but untested :D

@JbIPS
Copy link
Author

JbIPS commented Nov 19, 2014

@:schemaOptions({
    minimize: false
})
class State extends Model<StateData>{}
class StateManager extends Manager<StateData, State>{}
state.create({_id: prefix, answers: new DynamicObject<String>()}, function(err, r){
     if(err != null)
        trace("Error: "+err);
    else
        trace("Result: "+r);
});

works for me! Great job ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants