guncebektas / meteor-friendly-slugs

Meteor package to generate URL friendly slugs from a field with auto-incrementation to ensure unique URLs.
65 stars 15 forks source link

Mongo error when using $inc operator #5

Closed alexcavender closed 9 years ago

alexcavender commented 9 years ago

First, thank you for making this package it's really amazing. I have a Meteor method increasePlayCount

increasePlayCount: function (DownloadId){ Downloads.update({slug:DownloadId}, {$inc: {plays:1 }}); },

Using $inc to increase a field in mongo gives me this error:

screen shot 2015-05-30 at 6 54 00 pm

Using $set works normally on my collections

If I remove my code that calls friendly slugs then I can use $inc with no errors Collection.friendlySlugs('name');

todda00 commented 9 years ago

This should be fixed in 0.3.1, please update to the latest!