Or install the
random package (
meteor add random) and use:
var newStringId = Random.id();
I use this occasionally in my apps.
The trouble comes when inserting documents to the database from outside a Meteor context. By default, a mongo object id is generated. The way around this is to explicitly provide a string
_id value on the document when inserting it. Then you need to have something equivalent to the meteor
random package that can generate (probably) globally unique identifier strings for you.