Appending to a >40 item array causing cpu to go >90%


I’m trying to append an id to a top level array that is indexed. The array has ~40 elements in it, all just about 10-12 chars in length. This is causing my cpu usage to spike to >90% and it is happening for any document I try to update. I’ve tried dropping the index to see if that helps but it didn’t. I’ve also tried appending a large, 40 element array to other fields and meteor had no problem with that.

I’ve tried $set, $addToSet, $push, all to no avail. This works perfectly fine when I do it directly through mongo. Has anyone encountered this issue before? I’m working with meteor 1.6.1 and mongo 3.4.10. Thanks.

Edit: Discovered a post-update hook, but removing that doesn’t fix the issue either

Update: I’ve discovered the issue is with a computed field, thank you for the suggestions.

What is the field used for? Is there any possibility that changing this field is causing a publication to do a large amount of work?

Can we see the actual query you’re using?

Tickets.update({ _id: 'someTicketId' }, { $push: { imageIds: 'newImageId' }})