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

[Add Keystone to Existing Apps] How to Utilize Existing Mongoose Models #1508

Plypy opened this Issue Jul 2, 2015 · 7 comments


None yet
8 participants

Plypy commented Jul 2, 2015

Based on the instruction given in WIKI, I modified my app.
Added this line to import my models defined.


Thing is, though I can access the keystone admin panel, I can't see anything. The panel is empty, no model monitored there.

Should I do a list.register() first to see it's shown in the panel. If it is, then how I can register a well-defined Mongoose model, or must I rewrite the model in keystone's List style?



This comment has been minimized.

shaond commented Jul 27, 2015

I have the same question as @Plypy, we have an existing app with quite a large number of models which are shared amongst a number of ExpressJS apps, but I'd love to integrate Keystone's Admin UI goodness.

We've got Keystone's route working, but like the OP, there's nothing in the Admin UI. A rewrite of our models into Keystone's List based format wouldn't be practical.

Is there a way to use our existing Mongoose models with Keystone's Admin UI?


This comment has been minimized.

hustKiwi commented Sep 2, 2015



This comment has been minimized.


morenoh149 commented Sep 2, 2015

@Plypy where is imports defined? it's not in keystone or mongoose.

list.register() is run from a mongoose object (I think) so try

and see if it get's wired up correctly.


This comment has been minimized.

cameronroe commented Sep 3, 2015

@Plypy Pretty sure the method is keystone.import

Alternatively, you can just require('./models') from your keystone.js file before the routes.


This comment has been minimized.

AlexYegupov commented Mar 9, 2016

+1 to shaond question
Is there ability or future plans to allow using in keystone existing application mongoose models without necessity to redefine their duplicates via MyMongooseModel.add({...})?


This comment has been minimized.


creynders commented Mar 10, 2016

@AlexYegupov I can't quite imagine how that would work, since keystone lists add a lot of functionality. Some kind of mapping mechanism? E.g. a mongoose schema defines a field as a string but keystone'll need to know what kind of string that is. Is it a text field? Or is it a Url? Et cetera.


This comment has been minimized.


mxstbr commented Apr 29, 2016

We're closing all questions and support requests to keep the issue tracker unpolluted. Please ask this question on Stackoverflow or Gitter instead!

@mxstbr mxstbr closed this Apr 29, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment