You can get it either synchronously:
var docId = Todos.insert({text: 'foo'}); console.log(docId);
Or asynchronously:
Todos.insert({text: 'foo'}, function(error, docId){ console.log(docId); });