I am learning node and mongodb
My app is working fine (Its is online tutorial app)
I have two Question
// define model =================
var Todo = mongoose.model('Todo', {
text : String
});
// create todo and send back all todos after creation
app.post('/api/todos', function(req, res) {
// create a todo, information comes from AJAX request from Angular
Todo.create({
text : req.body.text,
done : false
}, function(err, todo) {
if (err)
res.send(err);
// get and return all the todos after you create another
Todo.find(function(err, todos) {
if (err)
res.send(err)
res.json(todos);
});
});
});
I hope you understand my code (Its todo adding app)
1) Is 'Todo' is collection in mongoDB ?
I typed on cmd db.collection.find()
but nothing result ? , Which command i use on cmd to see data here
2) Can I open DB data storage file in my editor with any tool ?
Online tutorial app link Thanks