SOLVED: A document is not saved

Deployed at

When I submit a tag, it’s not being saved.

Posts are created w/o any problem.

Related parts as follows.


Tags = new Mongo.Collection('tags');

    tagInsert: function (tagAttributes) {
        check(Meteor.userId(), String);
        check(tagAttributes, {
            title: String
        var user = Meteor.user();
        var tag = _.extend(tagAttributes, {
            userId: user._id,
            author: user.username,
            submitted: new Date()
        var tagId = Tags.insert(tag);
        return {
            _id: tagId


Meteor.publish('tags', function () {
    return Tags.find();

    'submit-form': function (e) {

        var tag = {
            title: $('[name=title]').val()
        };'tagInsert', tag, function (error, result) {
            //display the error to the user and abort
            if (error)
                return alert(error.message);
            Router.go('tagPage', {_id: result._id});


<template name="tagSubmit">
    <form class="main form page">
        <div class="form-group">
            <label class="control-label" for="title">Title</label>

            <div class="controls">
                <input name="title" id="title" type="text" value="" placeholder="Name your tag" class="form-control">
        <input type="submit" value="Submit" class="btn btn-primary">

I don’t see anything wrong. No server-side error when inserting? Is the tag inserted on server? (you can check that with console.log(Tags.find().fetch()) somewhere on server).

Where would I run the command above?

I checked that nothing is saved in the meteor mongo shell.

‘submit form’

typos rulezz

Thanks a lot! :smile: