Meteor-Community-Packages / meteor-collection-hooks

Meteor Collection Hooks
https://atmospherejs.com/matb33/collection-hooks
MIT License
657 stars 92 forks source link

Meteor.users.after.insert (userId, doc) -> returning an array as doc._id #20

Closed hamal closed 10 years ago

hamal commented 10 years ago

Hi, the function Meteor.users.after.insert (userId, doc) is returning an array for the property doc._id. I have to use doc._id[0]._id to access the real _id of the created object. I have no clue about this problem.

tmeasday commented 10 years ago

I'm seeing this problem too (for a general collection)

matb33 commented 10 years ago

OK, I'll look at this ASAP. Is it possibly occurring only on sync calls to insert?

tmeasday commented 10 years ago

By sync do you mean on the server?

In my case it was objects being created on the client and after insert calls happening on the server.

Let me know if you can't reproduce and I'll make a proper reproduction.

matb33 commented 10 years ago

By sync I meant insert without a callback. I have a feeling it's related to that. I'll be getting around to this soon