Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

All over the net i cant find a good tutorial for mongodb basics with node.js - socket.io So my question is:

  1. An example for inserting into mongodb with node.js-socket.io
  2. Update the records
  3. Take from mongo database so

in php/mysql is:

<?php
$con = mysql_connect("localhost","peter","abc123");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("my_db", $con);

mysql_query("INSERT INTO Persons (FirstName, LastName, Age)
VALUES ('Peter', 'Griffin',35)");

mysql_query("INSERT INTO Persons (FirstName, LastName, Age) 
VALUES ('Glenn', 'Quagmire',33)");

mysql_close($con);
?>

How this code looks like in mongoDB/node.js-socket.io

share|improve this question
    
some site for mongodb/node.js like w3school for php/mysql ??? –  Peter Web May 12 '12 at 20:19
add comment

1 Answer

up vote 1 down vote accepted

This page contains some simple examples which I've tried out a while back.

http://howtonode.org/node-js-and-mongodb-getting-started-with-mongojs

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.