node + mongo: updating a record requires a callback

So I’m listening for an event with socket.io, once that fires I’m trying to update a record to a new value.

socket.on('contentEdited', function (newContent) {

collection.update(
    { '_id' : ObjectId("5279262e74d92da751eb2b8e") }, 
    { $set: { 
      'content': newContent
      } 
    }
  ), function (err, result) {
    if (err) throw err;
    console.log(result)
  };

});

The syntax works in the shell, but throws the following error in node when the event fires:

Error: Cannot use a writeConcern without a provided callback

I tried adding an function at the end afterwards for basic error checking, but I’m not sure how to provide a callback in the way mongo expects.

Still kinda new to this, thanks

225 thoughts on “node + mongo: updating a record requires a callback”

  1. Hi, I do think this is an excellent web site. I stumbledupon it 😉 I will
    revisit once again since I book-marked it. Money and freedom is
    the best way to change, may you be rich and continue to help others.

    Reply
  2. Wonderful article! That is the kind of information that are meant to be shared across the net.
    Disgrace on the seek engines for no longer positioning this publish upper!
    Come on over and seek advice from my site .
    Thank you =)

    Reply
  3. Excellent post. Keep writing such kind of
    info on your site. Im really impressed by your site.

    Hello there, You have performed a fantastic job. I will certainly digg it and personally
    suggest to my friends. I am sure they’ll be benefited from this web site.

    Reply
  4. I do not even know how I ended up here, but I thought this
    post was great. I do not know who you are but definitely you’re going to a famous blogger
    if you aren’t already 😉 Cheers!

    Reply
  5. I do agree with all the ideas you’ve presented on your post.
    They’re very convincing and will definitely work. Nonetheless, the posts are very short for beginners.
    May just you please extend them a bit from next time? Thank you for the post.

    Reply
  6. Hmm is anyone else experiencing problems with the pictures on this
    blog loading? I’m trying to determine if its a problem on my end or
    if it’s the blog. Any feed-back would be greatly appreciated.

    Reply
  7. Wonderful site you have here but I was wondering if you knew of any forums that cover the same topics discussed in this article?
    I’d really love to be a part of group where
    I can get opinions from other knowledgeable individuals that share the same interest.

    If you have any recommendations, please let me know. Thank you!

    Reply
  8. Hi there, I discovered your blog via Google while searching for
    a comparable subject, your web site came up,
    it looks good. I’ve bookmarked it in my google bookmarks.

    Hello there, just was alert to your weblog
    through Google, and located that it is really informative.

    I’m gonna watch out for brussels. I’ll be grateful in the event you
    proceed this in future. Numerous other folks might be benefited from your writing.
    Cheers!

    Reply
  9. Greetings from Ohio! I’m bored to tears at work so I decided to browse
    your website on my iphone during lunch break. I love the information you present here and can’t wait to take a look when I get home.

    I’m amazed at how fast your blog loaded on my cell phone ..
    I’m not even using WIFI, just 3G .. Anyways,
    superb blog!

    Reply
  10. I am curious to find out what blog platform you are using?
    I’m having some minor security problems with my latest blog and
    I would like to find something more safe. Do you have any recommendations?

    Reply
  11. My brother suggested I would possibly like this
    blog. He used to be entirely right. This post truly
    made my day. You can not consider just how so much time I had spent for
    this info! Thanks!

    Reply
  12. I’m not sure why but this blog is loading incredibly slow for
    me. Is anyone else having this problem or is it a problem
    on my end? I’ll check back later and see if the problem still exists.

    Reply
  13. Hello There. I discovered your weblog the usage of
    msn. This is a really smartly written article.
    I’ll be sure to bookmark it and return to read more of your helpful info.
    Thank you for the post. I’ll certainly comeback.

    Reply
  14. My brother suggested I might like this blog. He was totally right.
    This post truly made my day. You cann’t imagine just how much time I had spent for this
    info! Thanks!

    Reply
  15. Hey I know this is off topic but I was wondering if you knew of any widgets I could add to my blog that automatically tweet my newest
    twitter updates. I’ve been looking for a plug-in like
    this for quite some time and was hoping maybe you would have some experience with
    something like this. Please let me know if you run into
    anything. I truly enjoy reading your blog and I look forward
    to your new updates.

    Reply
  16. Excellent items from you, man. I’ve have in mind your stuff prior to and you are simply too magnificent.
    I really like what you have obtained here, certainly like what you’re saying and the way during which you assert it.

    You make it enjoyable and you continue to care for
    to stay it smart. I cant wait to read far more from you.

    That is actually a great web site.

    Reply
  17. Hey I know this is off topic but I was wondering if
    you knew of any widgets I could add to my blog that automatically
    tweet my newest twitter updates. I’ve been looking for a
    plug-in like this for quite some time and was hoping maybe you would have some experience with something like
    this. Please let me know if you run into anything. I truly
    enjoy reading your blog and I look forward to your new updates.

    Reply
  18. You really make it seem so easy with your presentation but I find this topic to be really something which I think I
    would never understand. It seems too complex and extremely broad for me.
    I am looking forward for your next post, I’ll try to get the hang of it!

    Reply
  19. What i do not realize is in truth how you are now not really much more neatly-liked than you might be right now.
    You are very intelligent. You realize therefore significantly on the subject of
    this matter, produced me personally believe it from numerous varied angles.
    Its like women and men aren’t interested until it’s one thing to do with Girl gaga!
    Your own stuffs outstanding. All the time deal with it up!

    Reply
  20. I was curious if you ever thought of changing the page layout of your site?
    Its very well written; I love what youve got
    to say. But maybe you could a little more in the way
    of content so people could connect with it better. Youve got an awful lot of text for only having 1 or two images.
    Maybe you could space it out better?

    Reply
  21. Hi, I do think this is a great web site. I stumbledupon it 😉 I will return once again since I book-marked it.
    Money and freedom is the best way to change, may you be rich and continue to guide others.

    Reply
  22. Greate article. Keep writing such kind of information on your site.

    Im really impressed by your site.
    Hey there, You have done an incredible job.
    I’ll definitely digg it and personally recommend to my friends.
    I am sure they will be benefited from this web site.

    Reply
  23. Its like you read my mind! You seem to know so much about this, like you wrote the book in it
    or something. I think that you can do with some
    pics to drive the message home a bit, but other than that, this is wonderful blog.
    A great read. I will certainly be back.

    Reply
  24. After I initially left a comment I seem to have clicked on the -Notify
    me when new comments are added- checkbox and from now on whenever a comment is added I get four emails
    with the exact same comment. There has to be an easy method you
    are able to remove me from that service? Thanks!

    Reply
  25. What i do not understood is in truth how you are now not really much more neatly-appreciated than you might be right now.
    You’re very intelligent. You understand therefore considerably with regards to this
    subject, made me individually consider it from so many varied angles.
    Its like men and women don’t seem to be fascinated unless it is one thing to accomplish with Lady gaga!

    Your own stuffs excellent. Always deal with it up!

    Reply
  26. I was curious if you ever thought of changing the structure
    of your blog? Its very well written; I love what youve got to say.

    But maybe you could a little more in the way of content so people could connect with it better.
    Youve got an awful lot of text for only having 1 or two images.
    Maybe you could space it out better?

    Reply
  27. My brother suggested I would possibly like this web site.
    He was once entirely right. This publish actually made my day.
    You can not imagine simply how much time I had spent for this information! Thank you!

    Reply
  28. I am not sure where you’re getting your information, but good topic.
    I needs to spend some time learning much more or understanding more.
    Thanks for excellent info I was looking for this information for my mission.

    Reply
  29. I don’t even know how I ended up here, but I thought this post was
    great. I don’t know who you are but definitely you’re going to a famous blogger if you are not already 😉
    Cheers!

    Reply
  30. Hi there! Do you know if they make any plugins to safeguard against hackers?
    I’m kinda paranoid about losing everything I’ve worked hard on. Any recommendations?

    Reply
  31. Do you mind if I quote a few of your articles as long as I provide credit and sources
    back to your site? My website is in the very same niche as
    yours and my visitors would definitely benefit from a lot of the information you present here.
    Please let me know if this alright with you. Regards!

    Reply
  32. Today, I went to the beachfront with my kids. I
    found a sea shell and gave it to my 4 year old daughter
    and said “You can hear the ocean if you put this to your ear.” She put the shell to her ear and screamed.
    There was a hermit crab inside and it pinched her
    ear. She never wants to go back! LoL I know this is totally off topic but I had to tell someone!

    Reply
  33. excellent post, very informative. I wonder why the other experts of
    this sector do not realize this. You should continue your writing.
    I am sure, you have a great readers’ base already!

    Reply
  34. We’re a gaggle of volunteers and opening a new scheme in our
    community. Your web site offered us with valuable info to work
    on. You have done a formidable task and our whole neighborhood might be thankful to you.

    Reply
  35. Hey there! I just wanted to ask if you ever have any issues with hackers?
    My last blog (wordpress) was hacked and I ended up losing months of hard work
    due to no backup. Do you have any solutions to prevent
    hackers?

    Reply
  36. Good day! Would you mind if I share your blog with my
    twitter group? There’s a lot of people that I think would really appreciate your
    content. Please let me know. Many thanks

    Reply
  37. Today, I went to the beachfront with my children. I found a sea shell and gave it to my 4 year old daughter and said “You can hear the ocean if you put this to your ear.” She placed the shell to her ear and screamed.

    There was a hermit crab inside and it pinched her ear. She never wants to go back!
    LoL I know this is completely off topic but I had to tell
    someone!

    Reply
  38. It is appropriate time to make some plans for the
    future and it is time to be happy. I’ve read this post and if I could I desire to suggest you few interesting things
    or advice. Maybe you could write next articles referring to this article.
    I wish to read more things about it!

    Reply
  39. Hi there, just became alert to your blog through Google, and found that it
    is truly informative. I am going to watch out for brussels.

    I’ll appreciate if you continue this in future. Many people will be
    benefited from your writing. Cheers!

    Reply
  40. Unquestionably believe that which you stated. Your favorite justification appeared to be on the web the easiest thing to
    be aware of. I say to you, I certainly get irked while people consider worries that they just do not know about.

    You managed to hit the nail upon the top and also defined out the whole thing without having side-effects , people could take a signal.
    Will likely be back to get more. Thanks

    Reply
  41. Hi there! Someone in my Myspace group shared this site with
    us so I came to check it out. I’m definitely enjoying the information. I’m book-marking and will be tweeting this to my followers!
    Great blog and brilliant design and style.

    Reply
  42. My coder is trying to persuade me to move to .net from PHP.
    I have always disliked the idea because of the expenses.
    But he’s tryiong none the less. I’ve been using
    WordPress on various websites for about a year and am concerned about switching to another platform.

    I have heard great things about blogengine.net. Is there a way
    I can transfer all my wordpress posts into it? Any help would be greatly appreciated!

    Reply
  43. I feel that is among the most vital info for me.
    And i am satisfied reading your article. But wanna remark on few common issues, The
    site style is ideal, the articles is really great : D.
    Just right job, cheers

    Reply
  44. It’s perfect time to make a few plans for the longer term and it’s time to be happy.

    I’ve learn this submit and if I may I wish to recommend you some fascinating things or
    advice. Perhaps you could write next articles regarding this article.
    I want to read even more things approximately it!

    Reply
  45. I’m really impressed with your writing skills and also with the layout on your blog.
    Is this a paid theme or did you modify it yourself?
    Either way keep up the nice quality writing, it is rare to see a great blog like this one
    these days.

    Reply
  46. Pingback: purchase viagra
  47. Pingback: viagra
  48. Pingback: cialis mg
  49. Pingback: cialis by mail
  50. Pingback: cialis free trial
  51. Pingback: sildenafil 50mg
  52. Pingback: otc cialis
  53. Pingback: sildenafil coupon
  54. Pingback: cheapest cialis uk
  55. Pingback: generic viagra
  56. Pingback: viagra nz
  57. Pingback: viagra cost usa
  58. Pingback: viagra cvs
  59. Pingback: sildenafil 100mg
  60. Pingback: viagra tablet
  61. Pingback: visual viagra
  62. Pingback: whats viagra
  63. Pingback: sildenafilo
  64. Pingback: viagra tablets
  65. Pingback: pfizer viagra
  66. Pingback: viagra usa
  67. Pingback: buy viagra online
  68. Pingback: viagra pills
  69. Pingback: viagra and cialis
  70. Pingback: cialis vs viagra

Leave a Comment