Skip to content

Latest commit

 

History

History
34 lines (29 loc) · 944 Bytes

README.md

File metadata and controls

34 lines (29 loc) · 944 Bytes

Simple Mean App

Simple application to Add, Update, Remove, Search records using MEAN stack Records generated based on field array defined in app.js list.

vm.fields = [
    {label: 'Name', key: 'name'},
    {label: 'Email', key: 'email'},
    {label: 'Phone', key: 'phone'}
];

Change above array to have your own fields, html generates input box as of now

and change below for update query in server.js

app.put('/records/:id', function(req, res, next){
    var id = req.params.id;
    records_collection.updateOne(
        {'_id': new ObjectId(id)},
        { $set: {
            'name' : req.body.name,
            'email': req.body.email,
            'phone': req.body.phone
            }
        }, function(err, results){
            console.log(results);
            res.json(results);
    });
});

This is for simple seed mean app at it basic level for learning.