简体   繁体   中英

How to create schema and display record from new mongodb Collection in Meanjs

i am developing an application on MEAN STACK. I want to show the data from an existing Collection in mongodb . But i am not getting the clear idea how to attach this Collection with mean stack.I have seen Article example and sign up process but little bit confuse.

How to set up new Collection with meanjs.

The most used tool for this is Mongoose . A mongoose model should be created on server side and in the server controllers you expose the required operations (Create, Read, Update, Delete etc). MEAN uses Mongoose.

On client side you create services which will access the server side controllers. The client side objects should have the same attributes as the server side model by convention.

I didn't use the MEAN Article example, but I used the Yeoman code generators to kick off some entities. I assume that the Article example follows the same pattern, so for server side model please check app/models, for the server side controllers check app/controllers, for client side services check public/modules/article/services.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM